- final List<Api> apis = mountPointApi.getApis();
- assertEquals("Unexpected api list size", 3, apis.size());
-
- final Set<String> actualApis = new TreeSet<>();
- for (final Api api : apis) {
- actualApis.add(api.getPath());
- final List<Operation> operations = api.getOperations();
- assertEquals("unexpected operation size on " + api.getPath(), 1, operations.size());
- assertEquals("unexpected operation method " + api.getPath(), "GET", operations.get(0)
- .getMethod());
- assertNotNull("expected non-null desc on " + api.getPath(), operations.get(0)
- .getNotes());
+
+ final ObjectNode pathsObject = mountPointApi.getPaths();
+ assertNotNull(pathsObject);
+
+ assertEquals("Unexpected api list size", 3, pathsObject.size());
+
+ final Set<String> actualUrls = new TreeSet<>();
+
+ final Iterator<Map.Entry<String, JsonNode>> fields = pathsObject.fields();
+ while (fields.hasNext()) {
+ final Map.Entry<String, JsonNode> field = fields.next();
+ final String path = field.getKey();
+ final JsonNode operations = field.getValue();
+ actualUrls.add(field.getKey());
+ assertEquals("unexpected operations size on " + path, 1, operations.size());
+
+ final JsonNode getOperation = operations.get("get");
+
+ assertNotNull("unexpected operation method on " + path, getOperation);
+
+ assertNotNull("expected non-null desc on " + path, getOperation.get("description"));