HttpURLConnection connection = (HttpURLConnection)postUrl.openConnection();
connection.setDoOutput(true);
connection.setRequestMethod("GET");
connection.setRequestProperty("Content-Type", MediaType.APPLICATION_JSON);
JSONObject body = new JSONObject(getResponseFor(connection));
assertThat(body.length(), is(2));
JSONObject properties = body.getJSONObject("properties");
assertThat(properties, is(notNullValue()));
assertThat(properties.length(), is(2));
assertThat(properties.getString("jcr:primaryType"), is("dna:root"));
assertThat(properties.get("jcr:uuid"), is(notNullValue()));
JSONObject children = body.getJSONObject("children");
assertThat(children.length(), is(1));
JSONObject system = children.getJSONObject("jcr:system");
assertThat(system.length(), is(2));
properties = system.getJSONObject("properties");
assertThat(properties.length(), is(1));
assertThat(properties.getString("jcr:primaryType"), is("dna:system"));
JSONArray namespaces = system.getJSONArray("children");
assertThat(namespaces.length(), is(1));
assertThat(namespaces.getString(0), is("dna:namespaces"));
assertThat(connection.getResponseCode(), is(HttpURLConnection.HTTP_OK));
connection.disconnect();