@Test public void testCreateConnection() throws SQLException { Connection connection = mock( Connection.class ); StaticConnectionProvider provider = new StaticConnectionProvider( connection ); Connection result = provider.createConnection( "user", "password" ); assertThat( result, is( equalTo( connection ) ) ); }
public Connection createConnection( final String user, final String password ) throws SQLException { return connection; }
StaticConnectionProvider implements ConnectionProvider { public Connection createConnection( final String user, final String password ) throws SQLException { return connection; } }
StaticConnectionProvider implements ConnectionProvider { public Connection createConnection( final String user, final String password ) throws SQLException { return connection; } StaticConnectionProvider( final Connection connection ); }
StaticConnectionProvider implements ConnectionProvider { public Connection createConnection( final String user, final String password ) throws SQLException { return connection; } StaticConnectionProvider( final Connection connection ); Connection createConnection( final String user, final String password ); Object getConnectionHash(); }
StaticConnectionProvider implements ConnectionProvider { public Connection createConnection( final String user, final String password ) throws SQLException { return connection; } StaticConnectionProvider( final Connection connection ); Connection createConnection( final String user, final String password ); Object getConnectionHash();  }