@Test public final void shouldReturnErrorWhenUnexpectedErrorOccured() throws Exception { doThrow(new RuntimeException()).when(passwordReminderService).generateAndSendNewPassword(Mockito.anyString()); String result = passwordResetController.processForgotPasswordFormView(EXISTING_USER_NAME); assertEquals("error", result); }
@RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody public String processForgotPasswordFormView(@RequestParam final String login) { if (StringUtils.isBlank(login)) { return "loginIsBlank"; } return performPasswordReseting(login); }
PasswordResetController { @RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody public String processForgotPasswordFormView(@RequestParam final String login) { if (StringUtils.isBlank(login)) { return "loginIsBlank"; } return performPasswordReseting(login); } }
PasswordResetController { @RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody public String processForgotPasswordFormView(@RequestParam final String login) { if (StringUtils.isBlank(login)) { return "loginIsBlank"; } return performPasswordReseting(login); }  }
PasswordResetController { @RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody public String processForgotPasswordFormView(@RequestParam final String login) { if (StringUtils.isBlank(login)) { return "loginIsBlank"; } return performPasswordReseting(login); }  @RequestMapping(value = "passwordReset", method = RequestMethod.GET) ModelAndView getForgotPasswordFormView(@RequestParam(required = false, defaultValue = FALSE) final Boolean iframe,
            @RequestParam(required = false, defaultValue = FALSE) final Boolean popup, final Locale locale); @RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody String processForgotPasswordFormView(@RequestParam final String login); }
PasswordResetController { @RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody public String processForgotPasswordFormView(@RequestParam final String login) { if (StringUtils.isBlank(login)) { return "loginIsBlank"; } return performPasswordReseting(login); }  @RequestMapping(value = "passwordReset", method = RequestMethod.GET) ModelAndView getForgotPasswordFormView(@RequestParam(required = false, defaultValue = FALSE) final Boolean iframe,
            @RequestParam(required = false, defaultValue = FALSE) final Boolean popup, final Locale locale); @RequestMapping(value = "passwordReset", method = RequestMethod.POST) @ResponseBody String processForgotPasswordFormView(@RequestParam final String login);  }