ConnectionPoolComponentImpl implements ConnectionPoolComponent { @Override public Connection newConnection(final Dbms dbms) { final String uri = DatabaseUtil.findConnectionUrl(dbmsHandlerComponent, dbms); final String username = unwrap(dbms.getUsername()); final char[] password = unwrap(passwordComponent.get(dbms)); return newConnection(uri, username, password); } @Inject  ConnectionPoolComponentImpl(
        final ConnectionDecorator connectionDecorator,
        final DbmsHandlerComponent dbmsHandlerComponent,
        final PasswordComponent passwordComponent,
        @Config(name = "connectionpool.maxAge", value = "30000") long maxAge,
        @Config(name = "connectionpool.maxRetainSize", value = "32") int maxRetainSize
    ); @ExecuteBefore(State.STOPPED) void closeOpenConnections(); @Override PoolableConnection getConnection(Dbms dbms); @Override PoolableConnection getConnection(
        final String uri,
        final String user,
        final char[] password
    ); @Override Connection newConnection(final Dbms dbms); @Override Connection newConnection(
        final String uri,
        final String username,
        final char[] password
    ); @Override void returnConnection(PoolableConnection connection); @Override int poolSize(); @Override int leaseSize(); @Override long getMaxAge(); @Override int getMaxRetainSize();  }
@Test void testNewConnection() throws Exception { String uri = "someurl"; String user = "a"; char[] password = "b".toCharArray(); Connection result = instance.newConnection(uri, user, password); assertNotNull(result); assertFalse(result.isClosed()); }