BroadcastingController extends BaseController implements CrudController<BroadcastingMessageResource, BroadcastingMessageResource> { @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) public MessageResource updateResource(@PathVariable("id") final Long id, @Valid @RequestBody final BroadcastingMessageResource resource) { LOG.info("Updating resource: {},{}", id, resource); facade.updateResource(id, resource); return new MessageResource(MessageType.INFO); }  @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(method = RequestMethod.GET) PagedResultResource<BroadcastingMessageResource> getPagedResource(final PagedRequest<BroadcastingMessageResource> request); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.GET) BroadcastingMessageResource getResource(@PathVariable("id") final Long id); @Override @ResponseStatus(HttpStatus.CREATED) @RequestMapping(method = RequestMethod.POST) BroadcastingMessageResource createResource(@Valid @RequestBody final BroadcastingMessageResource resource); @Override @ResponseStatus(HttpStatus.OK) @RequestMapping(value = Request.ID, method = RequestMethod.PUT) MessageResource updateResource(@PathVariable("id") final Long id, 
			@Valid @RequestBody final BroadcastingMessageResource resource); @Override @ResponseStatus(HttpStatus.NO_CONTENT) @RequestMapping(value = Request.ID, method = RequestMethod.DELETE) MessageResource removeResource(@PathVariable("id") final Long id);  }
@Test public void testUpdateBroadcastingMessage() throws Exception { Long id = 1L; Long group1 = 1L; Long group2 = 2L; List<Long> groups = Arrays.asList(group1, group2); String recipient1 = "recipient1@edu.lviv.ua"; String recipient2 = "recipient2@edu.lviv.ua"; List<String> recipient = Arrays.asList(recipient1, recipient2); String content = "content"; String topic = "topic"; BroadcastingMessageResource resource = new BroadcastingMessageResource(); resource.setContent(content); resource.setTopic(topic); resource.setRecipients(recipient); resource.setGroups(groups); resource.setId(id); MessageResource responseResource = new MessageResource(MessageType.INFO); String request = getJson(resource, true); String response = getJson(responseResource, false); mockMvc.perform(put("/broadcastings/{id}", id) .contentType(MediaType.APPLICATION_JSON) .content(request)) .andExpect(status().isOk()) .andExpect(content().string(response)); verify(facade).updateResource(id, resource); }