@Test public void testLogin() throws Exception { ModelAndView actualModelAndView = controller.perform( get("/login") ).andReturn().getModelAndView(); assertEquals("loginPage", actualModelAndView.getViewName()); }
@RequestMapping(value = "/login", method = RequestMethod.GET) public ModelAndView login(final HttpServletResponse response) { if (startupManager.isBootstrapConfigRequired()) { return new ModelAndView(Constants.REDIRECT_BOOTSTRAP); } if (startupManager.isConfigRequired()) { return new ModelAndView(Constants.REDIRECT_STARTUP); } ModelAndView view = new ModelAndView("loginPage"); response.addHeader("login-required", "true"); return view; }
LoginController { @RequestMapping(value = "/login", method = RequestMethod.GET) public ModelAndView login(final HttpServletResponse response) { if (startupManager.isBootstrapConfigRequired()) { return new ModelAndView(Constants.REDIRECT_BOOTSTRAP); } if (startupManager.isConfigRequired()) { return new ModelAndView(Constants.REDIRECT_STARTUP); } ModelAndView view = new ModelAndView("loginPage"); response.addHeader("login-required", "true"); return view; } }
LoginController { @RequestMapping(value = "/login", method = RequestMethod.GET) public ModelAndView login(final HttpServletResponse response) { if (startupManager.isBootstrapConfigRequired()) { return new ModelAndView(Constants.REDIRECT_BOOTSTRAP); } if (startupManager.isConfigRequired()) { return new ModelAndView(Constants.REDIRECT_STARTUP); } ModelAndView view = new ModelAndView("loginPage"); response.addHeader("login-required", "true"); return view; }  }
LoginController { @RequestMapping(value = "/login", method = RequestMethod.GET) public ModelAndView login(final HttpServletResponse response) { if (startupManager.isBootstrapConfigRequired()) { return new ModelAndView(Constants.REDIRECT_BOOTSTRAP); } if (startupManager.isConfigRequired()) { return new ModelAndView(Constants.REDIRECT_STARTUP); } ModelAndView view = new ModelAndView("loginPage"); response.addHeader("login-required", "true"); return view; }  @RequestMapping(value = "/login", method = RequestMethod.GET) ModelAndView login(final HttpServletResponse response); @RequestMapping(value = "/loginviewdata", method = RequestMethod.GET) @ResponseBody LoginViewData getLoginViewData(final HttpServletRequest request); }
LoginController { @RequestMapping(value = "/login", method = RequestMethod.GET) public ModelAndView login(final HttpServletResponse response) { if (startupManager.isBootstrapConfigRequired()) { return new ModelAndView(Constants.REDIRECT_BOOTSTRAP); } if (startupManager.isConfigRequired()) { return new ModelAndView(Constants.REDIRECT_STARTUP); } ModelAndView view = new ModelAndView("loginPage"); response.addHeader("login-required", "true"); return view; }  @RequestMapping(value = "/login", method = RequestMethod.GET) ModelAndView login(final HttpServletResponse response); @RequestMapping(value = "/loginviewdata", method = RequestMethod.GET) @ResponseBody LoginViewData getLoginViewData(final HttpServletRequest request);  }