SearchUserController { @GetMapping("searchuser") public String searchuser(Model model, @RequestParam(value = "user_id", defaultValue = "") String keyword, @RequestParam(value = "position", required = false) String position, @PageableDefault(1000) Pageable pageable) { if (keyword.replace("%", "").length() < 2) { throw new BusinessException(BusinessCode.USER_SEARCH_KEYWORD_SHORT); } String like = keyword; if (position == null) { like = "%" + like + "%"; } else if (position.equalsIgnoreCase("begin")) { like += "%"; } else { like = "%" + like; } Pageable t = pageable; if (t.getSort() == null) { t = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by( Sort.Order.desc("solved"), Sort.Order.asc("submit") )); } Page<User> users = accountService.findAll(AccountForm.builder().disabled(Boolean.FALSE).query(like).build(), t); model.addAttribute("query", keyword); model.addAttribute("users", users); return "users/search"; }  @GetMapping("searchuser") String searchuser(Model model,
            @RequestParam(value = "user_id", defaultValue = "") String keyword,
            @RequestParam(value = "position", required = false) String position,
            @PageableDefault(1000) Pageable pageable);  }
@Test public void testSearchuser() throws Exception { log.info("searchuser"); String userId = mockDataService.user().getId(); String position = ""; MvcResult result = mvc.perform(get("/searchuser") .param("user_id", userId) .param("position", position)) .andExpect(status().isOk()) .andExpect(content().contentTypeCompatibleWith(MediaType.TEXT_HTML)) .andReturn(); }