/** * Make sure no {@link NullPointerException} is being thrown. * * @see Ticket #110 */ @Test public void testFinderInvocationWithNullParameter() { flushTestUsers(); userDao.findByLastname(null); }
@Test public void executesManipulatingQuery() throws Exception { flushTestUsers(); userDao.renameAllUsersTo("newLastname"); assertEquals(userDao.count().intValue(), userDao.findByLastname("newLastname").size()); }
/** * 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)); }