MongoClientWrapper implements DittoMongoClient { public static MongoClientWrapper newInstance(final MongoDbConfig mongoDbConfig) { return (MongoClientWrapper) getBuilder(mongoDbConfig).build(); } 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 createByUriWithSslDisabled() { final boolean sslEnabled = false; final String uri = createUri(sslEnabled); final Config config = CONFIG.withValue(MONGO_URI_CONFIG_KEY, ConfigValueFactory.fromAnyRef(uri)); final DefaultMongoDbConfig mongoDbConfig = DefaultMongoDbConfig.of(config); final MongoClientWrapper underTest = MongoClientWrapper.newInstance(mongoDbConfig); assertWithExpected(underTest, false, true); }
@Test public void createByUriWithSslEnabled() { final String uriWithSslEnabled = createUri(true); final Config config = CONFIG.withValue(MONGO_URI_CONFIG_KEY, ConfigValueFactory.fromAnyRef(uriWithSslEnabled)); final DefaultMongoDbConfig mongoDbConfig = DefaultMongoDbConfig.of(config); final MongoClientWrapper underTest = MongoClientWrapper.newInstance(mongoDbConfig); assertWithExpected(underTest, true, true); }
@Test public void createWithSslEnabled() { final String uriWithSslEnabled = createUri(true); final Config config = CONFIG.withValue(MONGO_URI_CONFIG_KEY, ConfigValueFactory.fromAnyRef(uriWithSslEnabled)) .withValue(MONGO_SSL_CONFIG_KEY, ConfigValueFactory.fromAnyRef("true")); final DefaultMongoDbConfig mongoDbConfig = DefaultMongoDbConfig.of(config); final MongoClientWrapper underTest = MongoClientWrapper.newInstance(mongoDbConfig); assertWithExpected(underTest, true, true); }