UserService { public User getUserByLogin(String login) { return userRepository.findUserByLogin(login); }  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 shouldGetAUserByLogin() { User user = userService.getUserByLogin("jdubois@ippon.fr"); assertThat(user, notNullValue()); assertThat(user.getAvatar(), is("avatar")); assertThat(user.getFirstName(), is("Julien")); assertThat(user.getLastName(), is("Dubois")); }
@Test public void shouldNotGetAUserByLogin() { User user = userService.getUserByLogin("unknownUserLogin"); assertThat(user, nullValue()); }