private JsonNode getBundleData()

in src/main/java/org/apache/sling/testing/clients/osgi/OsgiConsoleClient.java [874:894]


    private JsonNode getBundleData(String symbolicName) throws ClientException {
        final String path = getBundlePath(symbolicName, ".json");
        final String content = this.doGet(path, SC_OK).getContent();
        final JsonNode root = JsonUtils.getJsonNodeFromString(content);

        if (root.get(JSON_KEY_DATA) == null) {
            throw new TestingValidationException(path + " does not provide '" + JSON_KEY_DATA + "' element, JSON content=" + content);
        }

        Iterator<JsonNode> data = root.get(JSON_KEY_DATA).elements();
        if (!data.hasNext()) {
            throw new TestingValidationException(path + "." + JSON_KEY_DATA + " is empty, JSON content=" + content);
        }

        final JsonNode bundle = data.next();
        if (bundle.get(JSON_KEY_STATE) == null) {
            throw new TestingValidationException(path + ".data[0].state missing, JSON content=" + content);
        }

        return bundle;
    }