DepartmentAddressController extends BaseController implements CrudController<DepartmentAddressResource, DepartmentAddressResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{departmentId}/addresses/{id}", method = RequestMethod.DELETE) public MessageResource removeResource(@PathVariable("id") final Long id) { LOG.info("Removing department address with id: {}", id); facade.removeResource(id); return new MessageResource(MessageType.INFO, "DepartmentAddress removed"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{departmentId}/addresses", method = RequestMethod.POST) DepartmentAddressResource createResource(@Valid @RequestBody final DepartmentAddressResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/addresses/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final DepartmentAddressResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/addresses/{id}", method = RequestMethod.GET) DepartmentAddressResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{departmentId}/addresses/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{departmentId}/addresses", method = RequestMethod.GET) PagedResultResource<DepartmentAddressResource> getPagedResource(final PagedRequest<DepartmentAddressResource> request);  }
@Test public void testDeleteDepatmentAddress() throws Exception { Long personId = 2L; Long Id = 1L; mockMvc.perform(delete("/departments/{departmentId}/addresses/{addressId}", personId, Id)) .andExpect(status().is(204)); verify(facade).removeResource(Id); }