コード例 #1
0
  /** @see DATADOC-230 */
  @Test
  public void removesEntityFromCollection() {

    template.remove(new Query(), "mycollection");

    Person person = new Person("Dave");

    template.save(person, "mycollection");
    assertThat(template.findAll(TestClass.class, "mycollection").size(), is(1));

    template.remove(person, "mycollection");
    assertThat(template.findAll(Person.class, "mycollection").isEmpty(), is(true));
  }
コード例 #2
0
 private void checkCollectionContents(Class<?> entityClass, int count) {
   assertThat(template.findAll(entityClass).size(), is(count));
 }