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