MailController { @GetMapping("mail") @SuppressWarnings("AssignmentToMethodParameter") public String mail(Model model, @RequestParam(value = "size", defaultValue = "20") int size, @RequestParam(value = "start", defaultValue = "1") long start, Authentication authentication) { if (start <= 0) { start = 1; } String currentUserId = authentication != null ? authentication.getName() : null; List<Mail> mails = mailMapper.findAllByTo(currentUserId, start - 1, size); model.addAttribute("userId", currentUserId); model.addAttribute("mails", mails); model.addAttribute("size", size); model.addAttribute("start", start); return "mails/list"; }  @GetMapping("deletemail") String delete(@RequestParam("mail_id") long mailId, Authentication authentication); @GetMapping("mail") @SuppressWarnings("AssignmentToMethodParameter") String mail(Model model,
            @RequestParam(value = "size", defaultValue = "20") int size,
            @RequestParam(value = "start", defaultValue = "1") long start,
            Authentication authentication); @PostMapping("send") @SuppressWarnings("AssignmentToMethodParameter") String send(@RequestParam("title") String title,
            @RequestParam("to") String to,
            @RequestParam("content") String content,
            Authentication authentication); @GetMapping({"sendpage", "send"}) @SuppressWarnings("AssignmentToMethodParameter") String sendPage(Model model,
            @RequestParam(value = "reply", defaultValue = "-1") long reply,
            @RequestParam(value = "to", defaultValue = "") String userId,
            Authentication authentication); @GetMapping("showmail") String showMail(Model model,
            @RequestParam("mail_id") long mailId,
            Authentication authentication);  }
@Test public void testMail() throws Exception { log.info("mail"); int size = 20; long start = 0; String userId = mockDataService.user().getId(); MvcResult result = mvc.perform(get("/mail").with(user(userId)) .param("size", Integer.toString(size)) .param("start", Long.toString(start))) .andExpect(status().isOk()) .andExpect(view().name("mails/list")) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML)) .andReturn(); }