Search in sources :

Example 11 with MongoDbFactory

use of org.springframework.data.mongodb.MongoDbFactory in project spring-cloud-connectors by spring-cloud.

the class MongoDbFactoryConfigWithServiceConfig method withConfigOnlyConnectionPerHostSpecified.

@Test
public void withConfigOnlyConnectionPerHostSpecified() {
    ApplicationContext testContext = getTestApplicationContext(MongoDbFactoryConfigWithServiceConfig.class, createService("my-service"));
    MongoDbFactory connector = testContext.getBean("connectionPerHost50_MaxWaitUnspecified_WriteConcernUnspecified", getConnectorType());
    MongoDbFactoryCloudConfigTestHelper.assertConfigProperties(connector, null, 50, 120000);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) MongoDbFactory(org.springframework.data.mongodb.MongoDbFactory) Test(org.junit.Test)

Example 12 with MongoDbFactory

use of org.springframework.data.mongodb.MongoDbFactory in project spring-cloud-connectors by spring-cloud.

the class MongoDbFactoryConfigWithServiceConfig method withConfigAllOptionsSpecifiedWriteConcernNone.

@Test
public void withConfigAllOptionsSpecifiedWriteConcernNone() {
    ApplicationContext testContext = getTestApplicationContext(MongoDbFactoryConfigWithServiceConfig.class, createService("my-service"));
    MongoDbFactory connector = testContext.getBean("connectionPerHost50_MaxWait200_WriteConcernNone", getConnectorType());
    MongoDbFactoryCloudConfigTestHelper.assertConfigProperties(connector, "none", 50, 200);
}
Also used : ApplicationContext(org.springframework.context.ApplicationContext) MongoDbFactory(org.springframework.data.mongodb.MongoDbFactory) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)12 MongoDbFactory (org.springframework.data.mongodb.MongoDbFactory)12 ApplicationContext (org.springframework.context.ApplicationContext)10 MongoClient (com.mongodb.MongoClient)2 MongoCredential (com.mongodb.MongoCredential)2 ServerAddress (com.mongodb.ServerAddress)2 MongoServiceInfo (org.springframework.cloud.service.common.MongoServiceInfo)2