PersonAddressController extends BaseController implements CrudController<PersonAddressResource, PersonAddressResource> { @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/addresses/{addressId}", method = RequestMethod.DELETE) @ApiOperation(value = "Method for deleting person address") public MessageResource removeResource(@PathVariable("addressId") final Long addressId) { LOG.info("Deletin person address({})", addressId); facade.removeResource(addressId); return new MessageResource(MessageType.INFO, "Person Address deleted"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{personId}/addresses", method = RequestMethod.POST) @ApiOperation(value = "Method for creating person address") PersonAddressResource createResource(@Valid @RequestBody final PersonAddressResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/addresses/{addressId}", method = RequestMethod.PUT) @ApiOperation(value = "Method for updating person address") MessageResource updateResource(@PathVariable("addressId") final Long addressId,
			@Valid @RequestBody final PersonAddressResource resource); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{personId}/addresses/{addressId}", method = RequestMethod.DELETE) @ApiOperation(value = "Method for deleting person address") MessageResource removeResource(@PathVariable("addressId") final Long addressId); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/addresses/{addressId}", method = RequestMethod.GET) @ApiOperation(value = "Method for getting person address by id") PersonAddressResource getResource(@PathVariable("addressId") final Long addressId); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{personId}/addresses", method = RequestMethod.GET) @ApiOperation(value = "Method for getting paged result.") PagedResultResource<PersonAddressResource> getPagedResource(final PagedRequest<PersonAddressResource> request);  }
@Test public void testDeletePersonAddress() throws Exception { Long personId = 2L; Long addressId = 1L; mockMvc.perform(delete("/persons/{persinId}/addresses/{addressId}", personId, addressId)) .andExpect(status().is(204)); verify(facade).removeResource(addressId); }