MarkScaleValueController extends BaseController implements CrudController<MarkScaleValueResource, MarkScaleValueResource> { @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(value = "/{markScaleId}/values", method = RequestMethod.POST) @ApiOperation(value = "Create MarkScale Value", position = 1) public MarkScaleValueResource createResource(@Valid @RequestBody final MarkScaleValueResource resource) { LOG.info("Creating markScale value: {}", resource); return facade.createResource(resource); }  @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 testCreateMarkScaleValue() throws Exception { Long markScaleId = 1L; Long id = 2L; MarkScaleValueResource markScaleValueResource = new MarkScaleValueResource(); markScaleValueResource.setId(id); String request = getJson(markScaleValueResource, true); String response = getJson(markScaleValueResource, false); when(facade.createResource(any(MarkScaleValueResource.class))).thenReturn(markScaleValueResource); mockMvc.perform(post("/marks/scales/{markScaleId}/values", markScaleId) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isCreated()) .andExpect(content().string(response)); verify(facade).createResource(markScaleValueResource); }