@Test public void testHome() throws Exception { mockMvc.perform(get("/")) .andExpect(view().name("redirect:/defaultLoginPage.html")); }
@RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String home() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (!(auth instanceof AnonymousAuthenticationToken)) { return "redirect:/defaultLoginPage.html"; } return "views/index"; }
HomeController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String home() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (!(auth instanceof AnonymousAuthenticationToken)) { return "redirect:/defaultLoginPage.html"; } return "views/index"; } }
HomeController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String home() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (!(auth instanceof AnonymousAuthenticationToken)) { return "redirect:/defaultLoginPage.html"; } return "views/index"; }  }
HomeController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String home() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (!(auth instanceof AnonymousAuthenticationToken)) { return "redirect:/defaultLoginPage.html"; } return "views/index"; }  @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") String home(); @RequestMapping(value = "/keep-alive", method = RequestMethod.GET) @ResponseBody void keepAlive(); @RequestMapping(value = "index.html", method = RequestMethod.GET) String index(Model model, HttpServletRequest request); @RequestMapping(value = "defaultLoginPage.html", method = RequestMethod.GET) String roleDispatcher(Model model, HttpServletRequest request); @RequestMapping(value = "error.html") String error(HttpServletRequest request, Model model); }
HomeController { @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") public String home() { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (!(auth instanceof AnonymousAuthenticationToken)) { return "redirect:/defaultLoginPage.html"; } return "views/index"; }  @RequestMapping(value = "/", method = RequestMethod.GET, produces = "text/html") String home(); @RequestMapping(value = "/keep-alive", method = RequestMethod.GET) @ResponseBody void keepAlive(); @RequestMapping(value = "index.html", method = RequestMethod.GET) String index(Model model, HttpServletRequest request); @RequestMapping(value = "defaultLoginPage.html", method = RequestMethod.GET) String roleDispatcher(Model model, HttpServletRequest request); @RequestMapping(value = "error.html") String error(HttpServletRequest request, Model model);  }