Exemple #1
0
  protected List<UserDepartment> getUserDepartments() {
    List<UserDepartment> departments = userService.getUserDepartments();

    Collections.sort(departments, new UserDepartmentComparator());

    return departments;
  }
Exemple #2
0
  /**
   * Get all departments from the backend
   *
   * @return
   */
  private List<UserDepartment> getUserDepartments() {
    if (departments == null) {
      departments = userService.getUserDepartments();
    }

    Collections.sort(departments, new UserDepartmentComparator());

    return departments;
  }
Exemple #3
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>());
  }
  /**
   * Get the user departments from the backend
   *
   * @return
   */
  private List<UserDepartment> getUserDepartments() {
    List<UserDepartment> userDepartments = userService.getUserDepartments();
    Collections.sort(userDepartments, new UserDepartmentComparator());

    return userDepartments;
  }