Пример #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());
 }