DirectConnectionProvider implements ConnectionProvider { @Override public CompletionStage<Void> close() { return connectionPool.close(); } DirectConnectionProvider( BoltServerAddress address, ConnectionPool connectionPool ); @Override CompletionStage<Connection> acquireConnection( ConnectionContext context ); @Override CompletionStage<Void> verifyConnectivity(); @Override CompletionStage<Void> close(); @Override CompletionStage<Boolean> supportsMultiDb(); BoltServerAddress getAddress();  }
@Test void closesPool() { BoltServerAddress address = BoltServerAddress.LOCAL_DEFAULT; ConnectionPool pool = poolMock( address, mock( Connection.class ) ); DirectConnectionProvider provider = new DirectConnectionProvider( address, pool ); provider.close(); verify( pool ).close(); }