@Test public void testArrayEquals() { MockObject o = new MockObject(); MockObject o1 = new MockObject(); o1.id = new org.bson.types.ObjectId().toString(); o.items = Arrays.asList(o1); coll.save(o); assertThat(coll.find().is("items", Arrays.asList(o1)).toArray(), hasSize(1)); }
@Test public void testAll() { MockObject o = new MockObject(); MockObject o1 = new MockObject(); o1.id = new org.bson.types.ObjectId().toString(); o.items = Arrays.asList(o1); coll.save(o); // Ensure that the serializer actually worked assertThat(coll.find().all("items", o1).toArray(), hasSize(1)); }