ForgotController { @RequestMapping(value = "/forgotviewdata", method = RequestMethod.GET) @ResponseBody public ForgotViewData getForgotViewData(final HttpServletRequest request) { ForgotViewData view = new ForgotViewData(); view.setLoginMode(settingsFacade.getPlatformSettings().getLoginMode()); view.setEmailGetter(true); view.setProcessed(false); view.setEmail(""); view.setPageLang(cookieLocaleResolver.resolveLocale(request)); return view; }  @RequestMapping(value = "/forgot", method = RequestMethod.GET) ModelAndView login(final HttpServletRequest request); @RequestMapping(value = "/forgotviewdata", method = RequestMethod.GET) @ResponseBody ForgotViewData getForgotViewData(final HttpServletRequest request); @RequestMapping(value = "/forgot", method = RequestMethod.POST) @ResponseBody String forgotPost(@RequestBody String email);  }
@Test public void tesValidView() { ForgotViewData result = controller.getForgotViewData(httpServletRequest); assertEquals(result.getEmail(), ""); assertThat(result.isEmailGetter(), Is.is(true)); assertThat(result.isProcessed(), Is.is(false)); }