OrderController extends BaseController implements CrudController<OrderResource, OrderResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) @ApiOperation(value = "Update Order", position = 2) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final OrderResource resource) { LOG.info("Updating order with id: {}, {}", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO, "Order Updated"); }  @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) @ApiOperation(value = "Create Order", position = 1) OrderResource createResource(@Valid @RequestBody final OrderResource orderResource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) @ApiOperation(value = "Update Order", position = 2) MessageResource updateResource(@PathVariable("id") final Long id,
			@Valid @RequestBody final OrderResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) @ApiOperation(value = "Get Order by id", position = 3) OrderResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) @ApiOperation(value = "Delete Order", position = 4) MessageResource removeResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) @ApiOperation(value = "Get Orders") PagedResultResource<OrderResource> getPagedResource(final PagedRequest<OrderResource> request);  }
@Test public void testUpdateOrder() throws Exception { Long id = 1L; String docNum = "docNum"; OrderResource orderResource = new OrderResource(); orderResource.setId(id); orderResource.setDocNum(docNum); MessageResource responseResource = new MessageResource(MessageType.INFO, "Order Updated"); String request = getJson(orderResource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/orders/{id}", id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, orderResource); }