UserController { @GetMapping("/") public String index(Authentication authentication) { return authentication == null ? "index" : "redirect:/user.html"; } @Autowired @SuppressWarnings("unchecked")  UserController(ObjectMapper objectMapper); @GetMapping("/") String index(Authentication authentication); @GetMapping("/user.html") String user(Authentication authentication, ModelMap modelMap); @GetMapping("/login") String login(ModelMap modelMap);  }
@Test public void index() throws Exception { doUser("/"); }