Search in sources :

Example 1 with ContainsMapLike

use of dev.morphia.test.models.errors.ContainsMapLike in project morphia by mongodb.

the class TestMapping method testMapLike.

@Test
public void testMapLike() {
    final ContainsMapLike ml = new ContainsMapLike();
    ml.m.put("first", "test");
    getDs().save(ml);
    final ContainsMapLike mlLoaded = getDs().find(ContainsMapLike.class).iterator(new FindOptions().limit(1)).next();
    assertNotNull(mlLoaded);
    assertNotNull(mlLoaded.m);
    assertTrue(mlLoaded.m.containsKey("first"));
}
Also used : FindOptions(dev.morphia.query.FindOptions) ContainsMapLike(dev.morphia.test.models.errors.ContainsMapLike) Test(org.testng.annotations.Test)

Aggregations

FindOptions (dev.morphia.query.FindOptions)1 ContainsMapLike (dev.morphia.test.models.errors.ContainsMapLike)1 Test (org.testng.annotations.Test)1