@Test public void shouldReturnSearchResults() { String searchParam = "abc"; Pagination pagination = new Pagination(1,2); userService.searchUser(searchParam,pagination); verify(userRepository).searchUser(searchParam,pagination); }
public List<User> searchUser(String searchParam, Pagination pagination) { return userRepository.searchUser(searchParam,pagination); }
UserService { public List<User> searchUser(String searchParam, Pagination pagination) { return userRepository.searchUser(searchParam,pagination); } }
UserService { public List<User> searchUser(String searchParam, Pagination pagination) { return userRepository.searchUser(searchParam,pagination); }  }
UserService { public List<User> searchUser(String searchParam, Pagination pagination) { return userRepository.searchUser(searchParam,pagination); }  static String getCommaSeparatedIds(List<Long> idList); @Transactional void create(User user, String resetPasswordLink); void createUser(User user, String passwordResetLink); @Transactional void update(User user); LinkedHashMap getPreferences(Long userId); void sendForgotPasswordEmail(User user, String resetPasswordLink); List<User> searchUser(String searchParam, Pagination pagination); User getUserWithRolesById(Long id); User getById(Long id); Long getUserIdByPasswordResetToken(String token); @Transactional void updateUserPassword(String token, String password); User getByUserName(String userName); User selectUserByUserNameAndPassword(String userName, String password); void updateUserPassword(Long userId, String password); @Transactional void disable(Long userId, Long modifiedBy); List<User> getUsersWithRightInNodeForProgram(Program program, SupervisoryNode node, String rightName); List<User> getUsersWithRightInHierarchyUsingBaseNode(Long nodeId, Program program, String rightName); List<User> getUsersWithRightOnWarehouse(Long id, String rightName); ArrayList<User> filterForActiveUsers(List<User> userList); Integer getTotalSearchResultCount(String searchParam); @Transactional String updateUserPreferences(Long userId, User user, Long programId, Long facilityId, List<Long> products); List<String> getSupervisoryRights(Long userId); }
UserService { public List<User> searchUser(String searchParam, Pagination pagination) { return userRepository.searchUser(searchParam,pagination); }  static String getCommaSeparatedIds(List<Long> idList); @Transactional void create(User user, String resetPasswordLink); void createUser(User user, String passwordResetLink); @Transactional void update(User user); LinkedHashMap getPreferences(Long userId); void sendForgotPasswordEmail(User user, String resetPasswordLink); List<User> searchUser(String searchParam, Pagination pagination); User getUserWithRolesById(Long id); User getById(Long id); Long getUserIdByPasswordResetToken(String token); @Transactional void updateUserPassword(String token, String password); User getByUserName(String userName); User selectUserByUserNameAndPassword(String userName, String password); void updateUserPassword(Long userId, String password); @Transactional void disable(Long userId, Long modifiedBy); List<User> getUsersWithRightInNodeForProgram(Program program, SupervisoryNode node, String rightName); List<User> getUsersWithRightInHierarchyUsingBaseNode(Long nodeId, Program program, String rightName); List<User> getUsersWithRightOnWarehouse(Long id, String rightName); ArrayList<User> filterForActiveUsers(List<User> userList); Integer getTotalSearchResultCount(String searchParam); @Transactional String updateUserPreferences(Long userId, User user, Long programId, Long facilityId, List<Long> products); List<String> getSupervisoryRights(Long userId);  }