MarkScaleExchangeController extends BaseController implements CrudController<MarkScaleExchangeResource, MarkScaleExchangeResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{markScaleId}/exchanges/{id}", method = RequestMethod.PUT) @ApiOperation(value = "Update MarkScale Exchange", position = 2) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final MarkScaleExchangeResource resource) { LOG.info("Updating markScale with id: {}, {}", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO, "MarkScale Exchange Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{markScaleId}/exchanges", method = RequestMethod.POST) @ApiOperation(value = "Create MarkScale Exchange", position = 1) MarkScaleExchangeResource createResource(@Valid @RequestBody final MarkScaleExchangeResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{markScaleId}/exchanges/{id}", method = RequestMethod.PUT) @ApiOperation(value = "Update MarkScale Exchange", position = 2) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final MarkScaleExchangeResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{markScaleId}/exchanges/{id}", method = RequestMethod.GET) @ApiOperation(value = "Get MarkScale Exchange by id", position = 3) MarkScaleExchangeResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = "/{markScaleId}/exchanges/{id}", method = RequestMethod.DELETE) @ApiOperation(value = "Delete MarkScale Exchange", position = 4) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = "/{markScaleId}/exchanges", method = RequestMethod.GET) @ApiOperation(value = "Get MarkScales Exchanges", position = 5) PagedResultResource<MarkScaleExchangeResource> getPagedResource(final PagedRequest<MarkScaleExchangeResource> request);  }
@Test public void testUpdateMarkScaleExchange() throws Exception { Long markScaleId = 2L; Long id = 1L; MarkScaleExchangeResource markScaleExchangeResource = new MarkScaleExchangeResource(); markScaleExchangeResource.setId(id); markScaleExchangeResource.setMarkScaleId(markScaleId); MessageResource responseResource = new MessageResource(MessageType.INFO, "MarkScale Exchange Updated"); String request = getJson(markScaleExchangeResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/marks/scales/{markScaleId}/exchanges/{contactId}", markScaleId, id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, markScaleExchangeResource); }