コード例 #1
0
  @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));
  }
コード例 #2
0
  @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));
  }