TableEntityController { @RequestMapping(value = "/delete", method = RequestMethod.DELETE) public ServiceResult<String> delete(@Validated(DeleteTableEntity.class) @RequestBody TaskTable taskTable, @CurrentUser LoginUser user, Errors errors) throws Exception { ValidateResult validateRes = tableEntityService.validatePermision(user, taskTable, errors) .addAssert(() -> tableEntityDao.deleteTask(taskTable) > 0, message.db_message_delete_operation_failed).validate(); if (!validateRes.isValid()) { return ServiceResult.fail(validateRes.getSummarize()); } return ServiceResult.success(); }  @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<TaskTableView>> list(@RequestBody Paging<TaskTable> paging); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> add(@Validated(AddTableEntity.class) @RequestBody TaskTable taskTable, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/adds", method = RequestMethod.POST) ServiceResult<String> adds(@Validated(AddTableEntity.class) @RequestBody List<TaskTable> list, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateTableEntity.class) @RequestBody TaskTable taskTable, @CurrentUser LoginUser user, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteTableEntity.class) @RequestBody TaskTable taskTable, @CurrentUser LoginUser user, Errors errors);  }
@Test public void delete() throws Exception { mockMvc.perform(MockMvcRequestBuilders.delete("/tableEntity/delete") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }