use of org.springframework.data.mongodb.config.StringToWriteConcernConverter in project cas by apereo.
the class MongoDbConnectionFactoryTests method verifyPackages.
@Test
public void verifyPackages() {
val props = new SingleCollectionMongoDbProperties();
props.setHost("localhost,localhost");
props.setPort(27017);
props.setUserId("root");
props.setPassword("password");
props.setDatabaseName("audit");
props.setAuthenticationDatabaseName("admin");
val factory = new MongoDbConnectionFactory(new StringToWriteConcernConverter()) {
@Override
protected Collection<String> getMappingBasePackages() {
return List.of(SampleDocument.class.getPackageName());
}
};
val template = factory.buildMongoTemplate(props);
assertNotNull(template);
}
Aggregations