예제 #1
0
  @Test
  public void testFindAll() {
    Product p2 = dao.save(new Product("foo2", "bar2"));
    Product p1 = dao.save(new Product("foo1", "bar1"));

    List<Product> ps = dao.findAll();

    assertThat("two objects where found", ps.size(), is(2));
    assertThat("retrieved object matches the persisted one", p1, is(ps.get(0)));
    assertThat("retrieved object matches the persisted one", p2, is(ps.get(1)));
  }