예제 #1
0
  /** Ensures that, if the id is valid, then retrieving a bookmark works as expected. */
  @Test
  public void testGet() {
    Bookmark result = dao.get(existing_bookmark.getId());

    assertNotNull(result);
    assertEquals(existing_bookmark.getId(), result.getId());
  }
예제 #2
0
  /** Ensures that removing a bookmark works as expected. */
  @Test
  public void testRemove() {
    dao.remove(existing_bookmark.getId());

    Bookmark result = dao.get(existing_bookmark.getId());

    assertNull(result);
  }
예제 #3
0
  /** Ensures that updating a bookmark works as expected. */
  @Test
  public void testUpdate() {
    existing_bookmark.setName(existing_bookmark.getName().toUpperCase());

    dao.update(existing_bookmark);

    Bookmark result = dao.get(existing_bookmark.getId());

    assertNotNull(result);
    assertEquals(existing_bookmark.getName(), result.getName());
  }