### Question:
UserProfileController { @RequestMapping(value = "/users/{editedUserId}/contacts", method = RequestMethod.GET) public ModelAndView showUserContacts(@PathVariable Long editedUserId) throws NotFoundException { JCUser editedUser = userService.get(editedUserId); return getUserProfileModelAndView(editedUser, CONTACTS); } @Autowired  UserProfileController(UserService userService,
                                 BreadcrumbBuilder breadcrumbBuilder,
                                 @Qualifier("avatarPreprocessor")
                                 ImageConverter imageConverter,
                                 PostService postService,
                                 UserContactsService contactsService,
                                 @Qualifier("avatarService") ImageService imageService,
                                 EntityToDtoConverter converter,
                                 RetryTemplate retryTemplate); @InitBinder void initBinder(WebDataBinder binder); @RequestMapping(value = "/user", method = RequestMethod.GET) ModelAndView showCurrentUserProfilePage(); @RequestMapping(value = {"/users/{editedUserId}/profile", "/users/{editedUserId}"}, method = RequestMethod.GET) ModelAndView showUserProfile(@PathVariable Long editedUserId); @RequestMapping(value = "/users/{editedUserId}/contacts", method = RequestMethod.GET) ModelAndView showUserContacts(@PathVariable Long editedUserId); @RequestMapping(value = "/users/{editedUserId}/notifications", method = RequestMethod.GET) ModelAndView showUserNotificationSettings(@PathVariable Long editedUserId); @RequestMapping(value = "/users/{editedUserId}/security", method = RequestMethod.GET) ModelAndView showUserSecuritySettings(@PathVariable Long editedUserId); @RequestMapping(value = "/users/*/profile", method = RequestMethod.POST) ModelAndView saveEditedProfile(@Valid @ModelAttribute(EDITED_USER) EditUserProfileDto editedProfileDto,
                                          BindingResult result, HttpServletResponse response); @RequestMapping(value = "/users/*/notifications", method = RequestMethod.POST) ModelAndView saveEditedNotifications(@Valid @ModelAttribute(EDITED_USER) EditUserProfileDto editedProfileDto,
                                                BindingResult result, HttpServletResponse response); @RequestMapping(value = "/users/*/security", method = RequestMethod.POST) ModelAndView saveEditedSecurity(@Valid @ModelAttribute(EDITED_USER) EditUserProfileDto editedProfileDto,
                                           BindingResult result, HttpServletResponse response,
                                           RedirectAttributes redirectAttributes); @RequestMapping(value = "/users/*/contacts", method = RequestMethod.POST) ModelAndView saveEditedContacts(@Valid @ModelAttribute(EDITED_USER) EditUserProfileDto editedProfileDto,
                                           BindingResult result, HttpServletResponse response); @RequestMapping(value = "/users/{id}/postList", method = RequestMethod.GET) ModelAndView showUserPostList(@PathVariable Long id,
                                         @RequestParam(value = "page", defaultValue = "1",
                                                 required = false) String page); @RequestMapping(value = "**/language", method = RequestMethod.GET) String saveUserLanguage(@RequestParam(value = "lang", defaultValue = "en") String lang,
                                   HttpServletResponse response, HttpServletRequest request); static final String SECURITY; static final String PROFILE; static final String NOTIFICATIONS; static final String CONTACTS; static final String EDIT_PROFILE; static final String EDITED_USER; static final String BREADCRUMB_LIST; static final String IS_PASSWORD_CHANGED_ATTRIB; }### Answer:
@Test public void showUserContactsShouldReturnUserView() throws NotFoundException { JCUser user = getUser(); user.setId(USER_ID); when(userService.getCurrentUser()).thenReturn(user); when(userService.get(USER_ID)).thenReturn(user); ModelAndView mav = profileController.showUserContacts(USER_ID); assertViewName(mav, "editProfile"); }