ClusterNodeController extends AbstractOhfController { @RequestMapping(method = RequestMethod.GET, produces = {"application/xml", "application/json"}) @ResponseStatus(HttpStatus.OK) @ResponseBody public CollectionWrapper<NodeRpc> findAll() { List<Node> nodes = nodeService.getAllNodes(); return new CollectionWrapper<>(new NodeRpc.NodeRpcConverter(), nodes); }  @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 findAll() throws Exception { final URIBuilder uriBuilder = createGetUrl(ROOT_URI); mockMvc.perform(get(toUrl(uriBuilder)) .accept(MediaType.APPLICATION_JSON) .with(SecurityMockMvcRequestPostProcessors.authentication(mockAuthentication("ADMIN")))) .andExpect(status().isOk()) .andExpect(jsonPath("data[0].id", equalTo(firstNode.getId().intValue()))) .andExpect(jsonPath("data[0].code", is(firstNode.getCode()))) .andExpect(jsonPath("data[0].name", is(firstNode.getName()))) .andExpect(jsonPath("data[0].description").doesNotExist()) .andExpect(jsonPath("data[0].state", is(firstNode.getState().name()))) .andExpect(jsonPath("data[1].id", equalTo(secondNode.getId().intValue()))) .andExpect(jsonPath("data[1].code", is(secondNode.getCode()))) .andExpect(jsonPath("data[1].name", is(secondNode.getName()))) .andExpect(jsonPath("data[1].description", is(secondNode.getDescription()))) .andExpect(jsonPath("data[1].state", is(secondNode.getState().name()))); }