### Question:
ChangePasswordController { @RequestMapping(value = {"/changepassword/{passwordHash:.*}"}, method = RequestMethod.GET) public String initialize(Model model, @PathVariable("passwordHash") String passwordHash) { log.debug("Requesting user for hash: {}", passwordHash); User user = new UserImpl(); model.addAttribute(ModelKeys.USER, user); user.setForgotPasswordHash(passwordHash); return ViewNames.PASSWORD_CHANGE; } @Autowired  ChangePasswordController(UserService userService, ChangePasswordValidator passwordValidator); @RequestMapping(value = {"/changepassword/{passwordHash:.*}"}, method = RequestMethod.GET) String initialize(Model model, @PathVariable("passwordHash") String passwordHash); @RequestMapping(value = {"/changepassword", "/changepassword/**"}, method = RequestMethod.POST) String update(@ModelAttribute UserForm user, BindingResult results, Model model, RedirectAttributes redirectAttributes);  }### Answer:
@Test public void testInitialize() throws Exception { final Model model = createNiceMock(Model.class); RedirectAttributes redirectAttributes = createNiceMock(RedirectAttributes.class); replay(redirectAttributes); replay(model); String viewName = controller.initialize(model, null); assertThat(viewName, CoreMatchers.equalTo(ViewNames.PASSWORD_CHANGE)); }