ClusterNodeController extends AbstractOhfController { @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.NO_CONTENT) @ResponseBody public void delete(@PathVariable final Long id) { nodeService.delete(nodeService.getNodeById(id)); }  @RequestMapping(method = RequestMethod.GET, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.OK) @ResponseBody CollectionWrapper<NodeRpc> findAll(); @RequestMapping(value = "/{id}", method = RequestMethod.GET, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.OK) @ResponseBody NodeRpc getById(@PathVariable final Long id); @RequestMapping(value = "/{id}", method = RequestMethod.PUT, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.NO_CONTENT) @ResponseBody void update(@PathVariable final Long id, @RequestBody @Valid final NodeRpc nodeRpc,
            BindingResult errors); @RequestMapping(value = "/{id}", method = RequestMethod.DELETE, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.NO_CONTENT) @ResponseBody void delete(@PathVariable final Long id); static final String REST_URI; }
@Test public void testDelete() throws Exception { final URIBuilder uriBuilder = createGetUrl(ROOT_URI + "/" + firstNode.getId()); mockMvc.perform(delete(toUrl(uriBuilder)) .contentType(MediaType.APPLICATION_JSON) .accept(MediaType.APPLICATION_JSON) .with(SecurityMockMvcRequestPostProcessors.authentication(mockAuthentication("ADMIN")))) .andExpect(status().isNoContent()); try { nodeService.getNodeById(firstNode.getNodeId()); fail("Node cannot not exist"); } catch (Exception e) { assertThat(e, instanceOf(NoDataFoundException.class)); } }