use of com.mongodb.async.client.MongoClientSettings in project spring-boot by spring-projects.
the class ReactiveMongoAutoConfigurationTests method optionsSslConfig.
@Test
public void optionsSslConfig() {
this.context = new AnnotationConfigApplicationContext();
EnvironmentTestUtils.addEnvironment(this.context, "spring.data.mongodb.uri:mongodb://localhost/test");
this.context.register(SslOptionsConfig.class, PropertyPlaceholderAutoConfiguration.class, ReactiveMongoAutoConfiguration.class);
this.context.refresh();
MongoClient mongo = this.context.getBean(MongoClient.class);
MongoClientSettings settings = mongo.getSettings();
assertThat(settings.getApplicationName()).isEqualTo("test-config");
assertThat(settings.getStreamFactoryFactory()).isSameAs(this.context.getBean("myStreamFactoryFactory"));
}
use of com.mongodb.async.client.MongoClientSettings in project spring-boot by spring-projects.
the class ReactiveMongoClientFactoryTests method extractServerAddresses.
private List<ServerAddress> extractServerAddresses(MongoClient client) {
MongoClientSettings settings = client.getSettings();
ClusterSettings clusterSettings = settings.getClusterSettings();
List<ServerAddress> allAddresses = clusterSettings.getHosts();
return allAddresses;
}
Aggregations