aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/org/onap
diff options
context:
space:
mode:
authorMichael Arrastia <MArrasti@amdocs.com>2018-12-17 17:34:37 +0000
committerMichael Arrastia <MArrasti@amdocs.com>2018-12-17 18:27:04 +0000
commit69d4c0a747053473355ee82aa426589324e50d82 (patch)
tree735d591809d861326ee7e3ec93ad8a49bd0d101e /src/test/java/org/onap
parent9a6079fe14815e6f247268ce32b3157cf95d734b (diff)
Use Schema Service for model ingestion
Change-Id: Id2531c52491c135ae000223caf7ce79f95a9cb43 Issue-ID: AAI-2010 Signed-off-by: Michael Arrastia <MArrasti@amdocs.com>
Diffstat (limited to 'src/test/java/org/onap')
-rw-r--r--src/test/java/org/onap/aai/spike/OXMModelLoaderSetup.java11
-rw-r--r--src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java6
2 files changed, 12 insertions, 5 deletions
diff --git a/src/test/java/org/onap/aai/spike/OXMModelLoaderSetup.java b/src/test/java/org/onap/aai/spike/OXMModelLoaderSetup.java
index 9315df8..837fa12 100644
--- a/src/test/java/org/onap/aai/spike/OXMModelLoaderSetup.java
+++ b/src/test/java/org/onap/aai/spike/OXMModelLoaderSetup.java
@@ -22,7 +22,9 @@ package org.onap.aai.spike;
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.HashSet;
import java.util.List;
+import java.util.Set;
import org.junit.Before;
import org.mockito.Mock;
import org.mockito.Mockito;
@@ -32,6 +34,7 @@ import org.onap.aai.setup.AAIConfigTranslator;
import org.onap.aai.setup.SchemaLocationsBean;
import org.onap.aai.setup.SchemaVersion;
import org.onap.aai.setup.SchemaVersions;
+import org.onap.aai.setup.Translator;
import org.onap.aai.spike.schema.EdgePropsConfiguration;
import org.onap.aai.spike.schema.EdgeRulesLoader;
import org.onap.aai.spike.schema.OXMModelLoader;
@@ -67,8 +70,12 @@ public class OXMModelLoaderSetup {
Mockito.when(edgePropsConfiguration.getEdgePropsDir()).thenReturn("src/test/resources/edgeProps/");
AAIConfigTranslator aaiConfigTranslator = new AAIConfigTranslator(schemaLocationsBean, schemaVersions);
- NodeIngestor nodeIngestor = new NodeIngestor(aaiConfigTranslator);
- EdgeIngestor edgeIngestor = new EdgeIngestor(aaiConfigTranslator, schemaVersions);
+ Set<Translator> translators = new HashSet<>();
+ translators.add(aaiConfigTranslator);
+ NodeIngestor nodeIngestor = new NodeIngestor(translators);
+ nodeIngestor.initialize();
+ EdgeIngestor edgeIngestor = new EdgeIngestor(translators);
+ edgeIngestor.initialize();
edgeRulesLoader = new EdgeRulesLoader(aaiConfigTranslator, edgeIngestor, edgePropsConfiguration);
oxmModelLoader = new OXMModelLoader(aaiConfigTranslator, nodeIngestor);
}
diff --git a/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java b/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java
index 2190942..1ee106c 100644
--- a/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java
+++ b/src/test/java/org/onap/aai/spike/event/incoming/OffsetManagerTest.java
@@ -1,5 +1,5 @@
/**
- * ============LICENSE_START=======================================================
+ * ============LICENSE_START=======================================================
* org.onap.aai
* ================================================================================
* Copyright © 2017-2018 AT&T Intellectual Property. All rights reserved.
@@ -33,10 +33,10 @@ public class OffsetManagerTest {
@Test
public void testOffsetAdvancement() throws Exception {
- final Long offsetPeriod = 500L; // ms
+ final Long offsetPeriod = 100L; // ms
// Create an instance of the offset manager.
- OffsetManager offsetManager = new OffsetManager(10, offsetPeriod);
+ OffsetManager offsetManager = new OffsetManager(5, offsetPeriod);
// Now, cache some events as if we had consumed them and they
// are in flight.