ServerGroupController { @RequestMapping(value = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<ServerGroupView>> loadPageList(@RequestBody Paging<ServerGroup> paging) throws SQLException { return ServiceResult.success(serverGroupService.findServerGroupPageList(paging)); }  @RequestMapping(value = "/loadAllServerGroups") ServiceResult<List<ServerGroup>> loadAllServerGroups(); @RequestMapping(value = "/serversNoGroup") ServiceResult<List<Server>> serversNoGroup(@RequestParam(value = "appGroupId", defaultValue = "0") Integer appGroupId); @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<ServerGroupView>> loadPageList(@RequestBody Paging<ServerGroup> paging); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddServerGroup.class) @RequestBody ServerGroup serverGroup, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateServerGroup.class) @RequestBody ServerGroup serverGroup, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteServerGroup.class) @RequestBody ServerGroup serverGroup, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/sync") ServiceResult<String> sync(@RequestParam("id") Long id, @CurrentUser LoginUser user); @RequestMapping(value = "/check") ConfigCkeckResult<ConfigCheckItem> check(@RequestParam("id") Long id, @CurrentUser LoginUser user);  }
@Test public void loadPageList() throws Exception { Paging<ServerGroup> paging = new Paging<>(); paging.setData(new ServerGroup()); String requestJson = JSONObject.toJSONString(paging); mockMvc.perform(MockMvcRequestBuilders.post("/serverGroup/list") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }