Neo4jDataSource implements javax.sql.DataSource { public String getUrl(String protocol) { String url = NEO4J_JDBC_PREFIX + protocol + ": "nossl," : ""); if (Objects.nonNull(getUser())) { url += "user=" + getUser(); if (Objects.nonNull(getPassword())) { url += ",password=" + getPassword(); } } return url; }  @Override PrintWriter getLogWriter(); @Override void setLogWriter(PrintWriter out); @Override void setLoginTimeout(int seconds); @Override int getLoginTimeout(); @Override Logger getParentLogger(); @Override T unwrap(Class<T> iface); @Override boolean isWrapperFor(Class<?> iface); String getServerName(); void setServerName(String serverName); String getUser(); void setUser(String user); String getPassword(); void setPassword(String password); int getPortNumber(); void setPortNumber(int portNumber); String getUrl(String protocol); boolean getIsSsl(); void setIsSsl(boolean ssl); static final String NEO4J_JDBC_PREFIX; }
@Test public void getUrlTest() throws SQLException { this.dataSource.setIsSsl(false); this.dataSource.setUser("test"); assertEquals("jdbc:neo4j:bolt: this.dataSource.setIsSsl(true); assertEquals("jdbc:neo4j:bolt: this.dataSource.setPassword("password"); this.dataSource.setIsSsl(false); assertEquals("jdbc:neo4j:bolt: assertEquals("jdbc:neo4j:http: this.dataSource.setPortNumber(7687); assertEquals("jdbc:neo4j:bolt: }