From 9034ac68d20e1cb9f9aeda9ed8445023fca92527 Mon Sep 17 00:00:00 2001 From: Fiete Ostkamp Date: Wed, 6 Mar 2024 07:56:05 +0100 Subject: Update janusgraph to 0.3.3 - update tinkerpop version from 3.2.11 to 3.3.0 - update janusgraph from 0.2.3 to 0.3.3 - the default GraphSON version would change with this update but was held back [1] - add jackson-dataformat-xml dependency to aai-core as the XmlMapper is used in the ErrorLogHelper [1] a separate story AAI-3796 - Use GraphSON v2 or v3 in AAI has been created for this Issue-ID: AAI-3795 Change-Id: I4539e83aa74c260d5238ebe869e9884d4396e9f4 Signed-off-by: Fiete Ostkamp --- .../src/test/java/org/onap/aai/TinkerpopUpgradeTests.java | 4 +++- .../src/test/java/org/onap/aai/db/DbMethHelperTest.java | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'aai-core/src/test') 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 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) -- cgit 1.2.3-korg