assertTrue(hasIndexedField("l", db.getCollection(mc.getCollectionName()).getIndexInfo()));
}
@Test
public void testUniqueIndexedEntity() throws Exception {
MappedClass mc = morphia.getMapper().getMappedClass(UniqueIndexClass.class);
ds.ensureIndexes();
assertTrue(hasIndexedField("l", db.getCollection(mc.getCollectionName()).getIndexInfo()));
ds.save(new UniqueIndexClass("a"));
try {
// this should throw...
ds.save(new UniqueIndexClass("v"));
assertTrue(false);
// } catch (MappingException me) {}
} catch (Throwable me) {
} // currently is masked by java.lang.RuntimeException: json can't
// serialize type : class com.mongodb.DBTimestamp
ds.ensureIndexes();
assertTrue(hasIndexedField("l", db.getCollection(mc.getCollectionName()).getIndexInfo()));
}