UserController { @RequestMapping(value = "/delete", method = RequestMethod.DELETE) public ServiceResult<String> delete(@Validated(DeleteUser.class) @RequestBody LoginUser user, @CurrentUser LoginUser currentUser, Errors errors) throws Exception { ValidateResult validateRes = userService.validatePermision(currentUser, errors) .addAssert(() -> userService.canUpdateOrDeleteUser(currentUser, user), message.permisson_user_crud) .addAssert(() -> loginUserDao.deleteUser(user.getId()) > 1, message.db_message_delete_operation_failed).validate(); if (!validateRes.isValid()) { return ServiceResult.fail(validateRes.getSummarize()); } return ServiceResult.success(); }  @RequestMapping(value = "/group/users") ServiceResult<List<LoginUser>> findGroupUserList(@RequestParam(value = "groupId", defaultValue = "0") Long groupId); @RequestMapping(value = "/list", method = RequestMethod.POST) ServiceResult<ListResult<LoginUserView>> findUserPageList(@RequestBody Paging<LoginUser> paging); @RequestMapping(value = "/getWorkInfo") ServiceResult<LoginUser> getWorkInfo(@RequestParam(value = "name", defaultValue = "") String name, @CurrentUser LoginUser user); @RequestMapping(value = "/add", method = RequestMethod.POST) ServiceResult<String> addUser(@Validated(AddUser.class) @RequestBody LoginUser user, @CurrentUser LoginUser currentUser, Errors errors); @RequestMapping(value = "/update", method = RequestMethod.PUT) ServiceResult<String> update(@Validated(UpdateUser.class) @RequestBody LoginUser user, @CurrentUser LoginUser currentUser, Errors errors); @RequestMapping(value = "/delete", method = RequestMethod.DELETE) ServiceResult<String> delete(@Validated(DeleteUser.class) @RequestBody LoginUser user, @CurrentUser LoginUser currentUser, Errors errors); @RequestMapping("/buttons") ServiceResult getDataBaseButton(@CurrentUser LoginUser user);  }
@Test public void delete() throws Exception { mockMvc.perform(MockMvcRequestBuilders.delete("/user/delete") .contentType(MediaType.APPLICATION_JSON_UTF8) .content(requestJson) .accept(MediaType.APPLICATION_JSON_UTF8)) .andExpect(MockMvcResultMatchers.status().isOk()) .andDo(MockMvcResultHandlers.print()); }