Exemple #1
0
  private List<User> getUsers() {
    List<User> users =
        currentFilter == null
            ? userService.getActiveUsers()
            : userService.getUsers(currentFilter.isActivateToggle());

    System.out.println("cf:" + currentFilter);

    Collections.sort(users, new UserComparator(false));

    return users;
  }
Exemple #2
0
  @Before
  public void setup_userservice() throws Exception {
    super.setUp();
    getMockContext().putBean("userService", userService);

    List<User> users = new ArrayList<User>();
    user = new User();
    user.setFirstName("thies");
    user.setUserId(1);
    user.setLastName("Edeling");
    user.setUserRoles(Sets.newHashSet(UserRole.ADMIN));
    users.add(user);

    when(userService.getActiveUsers()).thenReturn(users);
    when(userService.getUserRoles()).thenReturn(new ArrayList<UserRole>());
    when(userService.getUserDepartments()).thenReturn(new ArrayList<UserDepartment>());
  }