Exemplo n.º 1
0
 @Test
 public void testExecuteNoPasswordHintUserName() throws Exception {
   action.setUsername("manager");
   final User user = userManager.getUserByUsername("admin");
   user.setPasswordHint("  ");
   userManager.save(user);
   assertEquals(Action.INPUT, action.execute());
   assertTrue(action.hasActionErrors());
   user.setPasswordHint(null);
   userManager.save(user);
   assertEquals(Action.INPUT, action.execute());
   assertTrue(action.hasActionErrors());
 }
Exemplo n.º 2
0
 @Override
 @SuppressWarnings("unchecked")
 public List<Project> getWithNonResolvedMessages(User user) {
   Query query =
       getSession()
           .createQuery(
               "select p as project from Project as p left join p.users as u where u = :user");
   query.setLong("user", user.getId());
   List<Project> result = query.list();
   addNonResolved(result);
   return result;
 }