MongoClientWrapper implements DittoMongoClient { public static DittoMongoClientBuilder.ConnectionCoordinatesStep getBuilder() { return MongoClientWrapperBuilder.newInstance(); } private  MongoClientWrapper(final MongoClient theMongoClient,
            final String defaultDatabaseName,
            final DittoMongoClientSettings theDittoMongoClientSettings,
            @Nullable final EventLoopGroup theEventLoopGroup); static MongoClientWrapper newInstance(final MongoDbConfig mongoDbConfig); static DittoMongoClientBuilder.ConnectionCoordinatesStep getBuilder(); static DittoMongoClientBuilder.GeneralPropertiesStep getBuilder(final MongoDbConfig mongoDbConfig); @Override MongoDatabase getDefaultDatabase(); @Override MongoCollection<Document> getCollection(final CharSequence name); @Override DittoMongoClientSettings getDittoSettings(); @Override MongoDatabase getDatabase(final String name); @Override @Deprecated com.mongodb.async.client.MongoClientSettings getSettings(); @Override Publisher<String> listDatabaseNames(); @Override Publisher<String> listDatabaseNames(final ClientSession clientSession); @Override ListDatabasesPublisher<Document> listDatabases(); @Override ListDatabasesPublisher<TResult> listDatabases(final Class<TResult> clazz); @Override ListDatabasesPublisher<Document> listDatabases(final ClientSession clientSession); @Override ListDatabasesPublisher<TResult> listDatabases(final ClientSession clientSession,
            final Class<TResult> clazz); @Override ChangeStreamPublisher<Document> watch(); @Override ChangeStreamPublisher<TResult> watch(final Class<TResult> tResultClass); @Override ChangeStreamPublisher<Document> watch(final List<? extends Bson> pipeline); @Override ChangeStreamPublisher<TResult> watch(final List<? extends Bson> pipeline,
            final Class<TResult> tResultClass); @Override ChangeStreamPublisher<Document> watch(final ClientSession clientSession); @Override ChangeStreamPublisher<TResult> watch(final ClientSession clientSession,
            final Class<TResult> tResultClass); @Override ChangeStreamPublisher<Document> watch(final ClientSession clientSession,
            final List<? extends Bson> pipeline); @Override ChangeStreamPublisher<TResult> watch(final ClientSession clientSession,
            final List<? extends Bson> pipeline, final Class<TResult> tResultClass); @Override Publisher<ClientSession> startSession(); @Override Publisher<ClientSession> startSession(final ClientSessionOptions options); @Override void close();  }
@Test public void createByHostAndPort() { final DittoMongoClient underTest = MongoClientWrapper.getBuilder() .hostnameAndPort(KNOWN_HOST, KNOWN_PORT) .defaultDatabaseName(KNOWN_DB_NAME) .connectionPoolMaxSize(KNOWN_MAX_POOL_SIZE) .connectionPoolMaxWaitQueueSize(KNOWN_MAX_POOL_WAIT_QUEUE_SIZE) .connectionPoolMaxWaitTime(Duration.ofSeconds(KNOWN_MAX_POOL_WAIT_SECS)) .build(); assertWithExpected(underTest, false, false); }
@Test public void createByHostAndPortWithSslEnabled() { final DittoMongoClient underTest = MongoClientWrapper.getBuilder() .hostnameAndPort(KNOWN_HOST, KNOWN_PORT) .defaultDatabaseName(KNOWN_DB_NAME) .connectionPoolMaxSize(KNOWN_MAX_POOL_SIZE) .connectionPoolMaxWaitQueueSize(KNOWN_MAX_POOL_WAIT_QUEUE_SIZE) .connectionPoolMaxWaitTime(Duration.ofSeconds(KNOWN_MAX_POOL_WAIT_SECS)) .enableSsl(true) .build(); assertWithExpected(underTest, true, false); }