AssetAddressController extends BaseController implements CrudController<AssetAddressResource, AssetAddressResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{assetId}/addresses/{id}", method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final AssetAddressResource resource) { LOG.info("Updated asset address with id: {}, {}", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO, "AssetAddress Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{assetId}/addresses", method = RequestMethod.POST) AssetAddressResource createResource(@Valid @RequestBody final AssetAddressResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{assetId}/addresses/{id}", method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final AssetAddressResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{assetId}/addresses/{id}", method = RequestMethod.GET) AssetAddressResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{assetId}/addresses/{id}", method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{assetId}/addresses", method = RequestMethod.GET) PagedResultResource<AssetAddressResource> getPagedResource(final PagedRequest<AssetAddressResource> request);  }
@Test public void testUpdateAssetAddress() throws Exception { Long id = 1L; AssetAddressResource assetResource = new AssetAddressResource(); assetResource.setId(id); MessageResource responseResource = new MessageResource(MessageType.INFO, "AssetAddress Updated"); String request = getJson(assetResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/assets/1/addresses/{id}", id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, assetResource); }