@GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response nodes() {
        log.trace(String.format(MESSAGE_NODE, QUERY));

        Set<OpenstackNode> osNodes = osNodeService.nodes();

        for (OpenstackNode osNode : osNodes) {
            osJsonNodes.add(codec(OpenstackNode.class).encode(osNode, this));
        }
        return ok(root).build();
    }
@Test
    public void testGetNodesPopulatedArray() {
        expect(mockOpenstackNodeService.nodes()).
                andReturn(ImmutableSet.of(openstackNode)).anyTimes();
        replay(mockOpenstackNodeService);

        final WebTarget wt = target();
        final String response = wt.path(PATH).request().get(String.class);
        final JsonObject result = Json.parse(response).asObject();

        assertThat(result, notNullValue());
        assertThat(result.names(), hasSize(1));
        assertThat(result.names().get(0), is("nodes"));
        final JsonArray jsonNodes = result.get("nodes").asArray();
        assertThat(jsonNodes, notNullValue());
        assertThat(jsonNodes.size(), is(1));
        assertThat(jsonNodes, hasNode(openstackNode));

        verify(mockOpenstackNodeService);
    }