ServerConfigController { @RequestMapping(value = "/add", method = RequestMethod.POST) public ServiceResult<String> add(@Validated(AddServerConfig.class) @RequestBody ServerConfig serverConfig, @CurrentUser LoginUser user, Errors errors) throws Exception { serverConfig.setUpdate_user_no(user.getUserNo()); ValidateResult validateRes = serverConfigService.validatePermision(user, errors) .addAssert(() -> serverConfigDao.insertServerAppConfig(serverConfig) > 0, message.db_message_add_operation_failed).validate(); if (!validateRes.isValid()) { return ServiceResult.fail(validateRes.getSummarize()); } return ServiceResult.success(); }  @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<Server>> loadPageList(@RequestBody Paging<ServerConfig> paging); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddServerConfig.class) @RequestBody ServerConfig serverConfig, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateServerConfig.class) @RequestBody ServerConfig serverConfig, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteServerConfig.class) @RequestBody ServerConfig serverConfig, @CurrentUser LoginUser user, Errors errors);  }
@Test public void add() throws Exception { mockMvc.perform(MockMvcRequestBuilders.post("/serverConfig/add") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }