use of dev.morphia.Morphia.createDatastore in project morphia by mongodb.
the class TestVersioning method testCanMapAnEntityWithAnAbstractVersionedParent.
@Test
public void testCanMapAnEntityWithAnAbstractVersionedParent() {
Datastore datastore = Morphia.createDatastore(getMongoClient(), TEST_DB_NAME);
Mapper mapper = datastore.getMapper();
mapper.map(VersionedChildEntity.class);
List<EntityModel> mappedEntities = mapper.getMappedEntities();
assertEquals(mappedEntities.size(), 2, mappedEntities.toString());
List<Class<?>> list = new ArrayList<>();
for (EntityModel entityModel : mappedEntities) {
list.add(entityModel.getType());
}
assertTrue(list.contains(VersionedChildEntity.class));
assertTrue(list.contains(AbstractVersionedBase.class));
}
Aggregations