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