use of dev.morphia.mapping.MapperOptions.Builder in project morphia by mongodb.
the class TestMapperOptions method lowercaseDefaultCollection.
@Test
public void lowercaseDefaultCollection() {
DummyEntity entity = new DummyEntity();
String collectionName = getMapper().getEntityModel(entity.getClass()).getCollectionName();
assertEquals(collectionName, "dummyEntity", "uppercase");
Builder builder = MapperOptions.builder(getMapper().getOptions());
final Datastore datastore = Morphia.createDatastore(getMongoClient(), getDatabase().getName(), builder.collectionNaming(NamingStrategy.lowerCase()).build());
collectionName = datastore.getMapper().getEntityModel(entity.getClass()).getCollectionName();
assertEquals(collectionName, "dummyentity", "lowercase");
}