PublicStrategyController { @RequestMapping(value = "/list", method = RequestMethod.POST) public ServiceResult<ListResult<PublicStrategyView>> list(@RequestBody Paging<PublicStrategy> paging) throws SQLException { return ServiceResult.success(publicStrategyService.findPublicShardingStrategyPageList(paging)); }  @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<PublicStrategyView>> list(@RequestBody Paging<PublicStrategy> paging); @RequestMapping(value = "/list") ServiceResult<List<PublicStrategy>> list(); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddPublicStrategy.class) @RequestBody PublicStrategy publicStrategy, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdatePublicStrategy.class) @RequestBody PublicStrategy publicStrategy, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeletePublicStrategy.class) @RequestBody PublicStrategy publicStrategy, @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);  }
@Test public void list() throws Exception { Paging<PublicStrategy> paging = new Paging<>(); paging.setData(new PublicStrategy()); String requestJson = JSONObject.toJSONString(paging); mockMvc.perform(MockMvcRequestBuilders.post("/publicStrategy/list") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }