Exemplo n.º 1
0
  /**
   * Make sure no {@link NullPointerException} is being thrown.
   *
   * @see Ticket #110
   */
  @Test
  public void testFinderInvocationWithNullParameter() {

    flushTestUsers();

    userDao.findByLastname(null);
  }
Exemplo n.º 2
0
  @Test
  public void executesManipulatingQuery() throws Exception {

    flushTestUsers();
    userDao.renameAllUsersTo("newLastname");

    assertEquals(userDao.count().intValue(), userDao.findByLastname("newLastname").size());
  }
Exemplo n.º 3
0
  /**
   * Tests, that searching by the lastname of the reference user returns exactly that instance.
   *
   * @throws Exception
   */
  @Test
  public void testFindByLastname() throws Exception {

    flushTestUsers();

    List<User> byName = userDao.findByLastname("Gierke");

    assertTrue(byName.size() == 1);
    assertEquals(firstUser, byName.get(0));
  }