@Test
public void findAll() throws Exception {

    final URIBuilder uriBuilder = createGetUrl(ROOT_URI);
    // performs GET: /api/cluster/nodes
    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())));
}