LoginController { @GetMapping({"loginpage", "login"}) public String login(Model model, @RequestParam(value = "url", required = false) @Nullable String back, @RequestHeader(value = "Referer", required = false) @Nullable String referrer, @RequestParam(value = "contest_id", required = false) @Nullable String contestId) { model.addAttribute("backURL", StringUtils.hasText(back) ? back : referrer); model.addAttribute("contestId", contestId); return "login"; }  @GetMapping({"loginpage", "login"}) String login(Model model,
            @RequestParam(value = "url", required = false) @Nullable String back,
            @RequestHeader(value = "Referer", required = false) @Nullable String referrer,
            @RequestParam(value = "contest_id", required = false) @Nullable String contestId);  }
@Test public void testLogin() throws Exception { log.info("login"); String url = ""; String referrer = ""; String contestId = ""; MvcResult result = mvc.perform(get("/loginpage") .param("url", url) .param("contest_id", contestId) .header("Referer", referrer)) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML)) .andReturn(); }