UserStatusController { @GetMapping("userstatus") @SuppressWarnings("AssignmentToMethodParameter") public String userStatus(Model model, @RequestParam(value = "size", defaultValue = "3") int display, @RequestParam(value = "user_id", required = false) String userId) { User user = accountService.findOne(userId); display = Math.max(Math.min(display, 9), 1); userId = user.getId(); long rank = userMapper.rank(userId) + 1; long rankFirst = Math.max(rank - display, 1); List<User> neighbours = userMapper.neighbours(userId, display); List<Long> solvedProblems = userProblemMapper.findAllSolvedByUserId(userId); model.addAttribute("neighbours", neighbours); model.addAttribute("solvedProblems", solvedProblems); model.addAttribute("rankFirst", rankFirst); model.addAttribute("user", user); model.addAttribute("rank", rank); log.debug("rankFirst = {}", rankFirst); return "users/status"; }  @GetMapping("userstatus") @SuppressWarnings("AssignmentToMethodParameter") String userStatus(Model model,
            @RequestParam(value = "size", defaultValue = "3") int display,
            @RequestParam(value = "user_id", required = false) String userId);  }
@Test public void testUserStatus() throws Exception { log.info("userStatus"); int size = 3; String userId = mockDataService.user().getId(); MvcResult result = mvc.perform(get("/userstatus") .param("size", Integer.toString(size)) .param("user_id", userId)) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML)) .andReturn(); }