AdminUnitController extends BaseController implements CrudController<AdminUnitResource, AdminUnitResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Delete Admin Unit by id") public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing Admin Unit with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "Asset removed"); }  @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "Get Admin Unit Types") PagedResultResource<AdminUnitResource> getPagedResource(final PagedRequest<AdminUnitResource> request); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) @ApiOperation(value = "Get Admin Unit by id") AdminUnitResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) @ApiOperation(value = "Create Admin Unit") AdminUnitResource createResource(@Valid @RequestBody final AdminUnitResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) @ApiOperation(value = "Update Admin Unit") MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final AdminUnitResource resource); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Delete Admin Unit by id") MessageResource removeResource(@PathVariable("id") final Long id);  }
@Test public void testDeleteAdminUnit() throws Exception { Long id = 1L; mockMvc.perform(delete("/adminunits/{id}", id)) .andExpect(status().is(204)); verify(facade).removeResource(id); }