UserService { public Collection<User> getUsersByLogin(Collection<String> logins) { final Collection<User> users = new ArrayList<User>(); User user; for (String login : logins) { user = userRepository.findUserByLogin(login); if (user != null) { users.add(user); } } return users; }  User getUserByLogin(String login); String getLoginByRssUid(String rssUid); User getUserByUsername(String username); Collection<User> getUsersByLogin(Collection<String> logins); List<User> getUsersForCurrentDomain(int pagination); void updateUser(User user); void updatePassword(User user); void createUser(User user); void createTatamibot(String domain); void deleteUser(User user); @Secured("ROLE_ADMIN") @CacheEvict(value = {"group-user-cache", "group-cache","suggest-users-cache"}, allEntries = true) boolean desactivateUser( String username ); void registerUser(User user); void lostPassword(User user); String validateRegistration(String key); void updateWeeklyDigestRegistration(boolean registration); void updateDailyDigestRegistration(boolean registration); String updateRssTimelinePreferences(boolean booleanPreferencesRssTimeline); boolean isDomainHandledByLDAP(String domain); Collection<UserDTO> buildUserDTOList(Collection<User> users); UserDTO buildUserDTO(User user);  }
@Test public void testGetUsersByLogin() { String login1 = "uuser@ippon.fr"; String login2 = "jdubois@ippon.fr"; Collection<String> logins = new ArrayList<String>(); logins.add(login1); logins.add(login2); mockAuthenticationOnUserService(login2); Collection<User> users = userService.getUsersByLogin(logins); assertEquals(2, users.size()); }