aboutsummaryrefslogtreecommitdiffstats
path: root/aai-core/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'aai-core/src/test/java')
-rw-r--r--aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java4
-rw-r--r--aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java14
2 files changed, 11 insertions, 7 deletions
diff --git a/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java b/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java
index 799f6060..f443b308 100644
--- a/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java
+++ b/aai-core/src/test/java/org/onap/aai/TinkerpopUpgradeTests.java
@@ -24,6 +24,7 @@ import org.junit.experimental.categories.Categories;
import org.junit.experimental.categories.Categories.IncludeCategory;
import org.junit.runner.RunWith;
import org.junit.runners.Suite.SuiteClasses;
+import org.onap.aai.db.DbMethHelperTest;
import org.onap.aai.introspection.sideeffect.DataLinkTest;
import org.onap.aai.parsers.query.GraphTraversalTest;
import org.onap.aai.query.builder.TraversalQueryTest;
@@ -45,7 +46,8 @@ import org.onap.aai.query.builder.TraversalURIOptimizedQueryTest;
DataLinkTest.class,
GraphTraversalTest.class,
TraversalQueryTest.class,
- TraversalURIOptimizedQueryTest.class
+ TraversalURIOptimizedQueryTest.class,
+ DbMethHelperTest.class
})
public class TinkerpopUpgradeTests {
}
diff --git a/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java b/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java
index 16faa5f1..c79b9148 100644
--- a/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java
+++ b/aai-core/src/test/java/org/onap/aai/db/DbMethHelperTest.java
@@ -36,6 +36,7 @@ import org.apache.commons.io.IOUtils;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.structure.VertexProperty;
import org.janusgraph.core.JanusGraphFactory;
import org.junit.After;
import org.junit.AfterClass;
@@ -44,10 +45,12 @@ import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Rule;
import org.junit.Test;
+import org.junit.experimental.categories.Category;
import org.junit.rules.ExpectedException;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.onap.aai.AAISetup;
+import org.onap.aai.TinkerpopUpgrade;
import org.onap.aai.exceptions.AAIException;
import org.onap.aai.introspection.Introspector;
import org.onap.aai.introspection.Loader;
@@ -62,6 +65,7 @@ import org.onap.aai.setup.SchemaVersion;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
+@Category(TinkerpopUpgrade.class)
@RunWith(value = Parameterized.class)
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
public class DbMethHelperTest extends AAISetup {
@@ -127,12 +131,10 @@ public class DbMethHelperTest extends AAISetup {
map.put("pserver.hostname", "testSearchVertexByIdentityMap-pserver-hostname-01");
Optional<Vertex> optionalVertex;
- try {
- optionalVertex = dbMethHelper.searchVertexByIdentityMap(type, map);
- } catch (Exception e) {
- throw new Exception(e);
- }
- Assert.assertEquals("vp[hostname->testSearchVertexById]", optionalVertex.get().property("hostname").toString());
+ optionalVertex = dbMethHelper.searchVertexByIdentityMap(type, map);
+
+ String hostname = (String) optionalVertex.get().property("hostname").value();
+ Assert.assertEquals("testSearchVertexByIdentityMap-pserver-hostname-01", hostname);
}
@Test(expected = AmbiguousMapAAIException.class)