summaryrefslogtreecommitdiffstats
path: root/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java')
-rw-r--r--aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java27
1 files changed, 14 insertions, 13 deletions
diff --git a/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java b/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
index 4475b3f2..c67be641 100644
--- a/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
+++ b/aai-schema-ingest/src/test/java/org/onap/aai/edges/JsonIngestorTest.java
@@ -20,17 +20,18 @@
package org.onap.aai.edges;
+import static com.jayway.jsonpath.Criteria.where;
+import static com.jayway.jsonpath.Filter.filter;
import static org.junit.Assert.*;
+import com.jayway.jsonpath.DocumentContext;
+import com.jayway.jsonpath.Filter;
+
import java.util.*;
+
import org.junit.Test;
import org.onap.aai.setup.SchemaVersion;
-import com.jayway.jsonpath.DocumentContext;
-import com.jayway.jsonpath.Filter;
-import static com.jayway.jsonpath.Criteria.where;
-import static com.jayway.jsonpath.Filter.filter;
-
public class JsonIngestorTest {
private SchemaVersion LATEST = new SchemaVersion("v14");
@@ -39,34 +40,34 @@ public class JsonIngestorTest {
@Test
public void test() {
- //setup
+ // setup
List<String> files = new ArrayList<>();
files.add("src/test/resources/edgeRules/test.json");
files.add("src/test/resources/edgeRules/test2.json");
files.add("src/test/resources/edgeRules/otherTestRules.json");
Map<SchemaVersion, List<String>> input = new TreeMap<>();
input.put(LATEST, files);
-
+
List<String> files2 = new ArrayList<>();
files2.add("src/test/resources/edgeRules/test.json");
input.put(V10, files2);
-
+
List<String> files3 = new ArrayList<>();
files3.add("src/test/resources/edgeRules/test3.json");
files3.add("src/test/resources/edgeRules/defaultEdgesTest.json");
input.put(V11, files3);
-
- //test
+
+ // test
JsonIngestor ji = new JsonIngestor();
Map<SchemaVersion, List<DocumentContext>> results = ji.ingest(input);
-
+
assertTrue(results.entrySet().size() == 3);
assertTrue(results.get(LATEST).size() == 3);
assertTrue(results.get(V11).size() == 2);
assertTrue(results.get(V10).size() == 1);
-
+
Filter f = filter(where("from").is("foo").and("contains-other-v").is("NONE"));
- List<Map<String, String>> filterRes = results.get(V10).get(0).read("$.rules.[?]",f);
+ List<Map<String, String>> filterRes = results.get(V10).get(0).read("$.rules.[?]", f);
assertTrue(filterRes.size() == 2);
}