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