예제 #1
0
 @Test
 public void testSearchByName_notFound() {
   String search = "not found string";
   executeClassSql();
   List<User> users = userDAO.searchByName(search);
   assertEquals(0, users.size());
 }
예제 #2
0
 @Test
 public void testSearchByName() {
   String search = "full";
   executeClassSql();
   List<User> users = userDAO.searchByName(search);
   assertEquals(1, users.size());
 }
예제 #3
0
 @Test
 public void testListUsersByEnabledStatus_disabled() {
   executeClassSql();
   List<User> users = userDAO.listUsersByEnabledStatus(false);
   assertEquals(1, users.size());
   List<Integer> foundIds = new ArrayList<Integer>();
   for (User user : users) {
     foundIds.add(user.getId());
   }
   assertTrue(foundIds.contains(3));
 }
예제 #4
0
 @Test
 public void testListUsersByEnabledStatus_nousers() {
   List<User> users = userDAO.listUsersByEnabledStatus(true);
   assertEquals(0, users.size());
 }
예제 #5
0
 @Test
 public void testGetByLoginNameIgnoreCase_notFound() {
   executeClassSql();
   assertNull(userDAO.getByLoginNameIgnoreCase("usernotfound"));
 }
예제 #6
0
 @Test
 public void testGetByLoginNameIgnoreCase_caseInsensitive() {
   executeClassSql();
   assertEquals(4, userDAO.getByLoginNameIgnoreCase("User4").getId());
 }
예제 #7
0
 @Test
 public void testGetByLoginName_ignoreCase() {
   executeClassSql();
   assertNull(userDAO.getByLoginName("User4"));
 }
예제 #8
0
 @Test
 public void testGetByLoginName() {
   executeClassSql();
   assertEquals(4, userDAO.getByLoginName("user4").getId());
 }