ForceDriver implements Driver { @Override public Connection connect(String url, Properties properties) throws SQLException { if (!acceptsURL(url)) { return null; } try { Properties connStringProps = getConnStringProperties(url); properties.putAll(connStringProps); ForceConnectionInfo info = new ForceConnectionInfo(); info.setUserName(properties.getProperty("user")); info.setPassword(properties.getProperty("password")); info.setSessionId(properties.getProperty("sessionId")); info.setSandbox(resolveSandboxProperty(properties)); PartnerConnection partnerConnection = ForceService.createPartnerConnection(info); return new ForceConnection(partnerConnection); } catch (ConnectionException | IOException e) { throw new SQLException(e); } }  @Override Connection connect(String url, Properties properties); @Override boolean acceptsURL(String url); @Override DriverPropertyInfo[] getPropertyInfo(String url, Properties info); @Override int getMajorVersion(); @Override int getMinorVersion(); @Override boolean jdbcCompliant(); @Override Logger getParentLogger();  }
@Test public void testConnect_WhenWrongURL() throws SQLException { Connection connection = driver.connect("jdbc:mysql: assertNull(connection); }