summaryrefslogtreecommitdiffstats
path: root/aai-core/src/test/java
diff options
context:
space:
mode:
authorNandkishor Patke <nandkishor-laxman.patke@t-systems.com>2024-01-22 08:36:29 +0000
committerGerrit Code Review <gerrit@onap.org>2024-01-22 08:36:29 +0000
commit948c9f53f6243507e8a8c3e9b562d63e2b8b846a (patch)
treec3608f6164c8f292f5e8edc5e0bc516473576ef9 /aai-core/src/test/java
parentcec75b770f280804d8c2a81fd15b054431125f96 (diff)
parent9901da168ffe52ed9a34e32d5a65a7a6e5ac9e5f (diff)
Merge "Revert "Update tinkerpop to 3.2.3 in aai-core""
Diffstat (limited to 'aai-core/src/test/java')
-rw-r--r--aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java233
1 files changed, 80 insertions, 153 deletions
diff --git a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java
index 31abc599..2a68e53d 100644
--- a/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java
+++ b/aai-core/src/test/java/org/onap/aai/introspection/sideeffect/DataLinkTest.java
@@ -92,122 +92,70 @@ public class DataLinkTest extends DataLinkSetup {
graphMgt.makePropertyKey(AAIProperties.LAST_MOD_TS).dataType(Long.class).cardinality(Cardinality.SINGLE).make();
graphMgt.commit();
- graph.traversal()
- .addV()
- .property("aai-node-type", "vpn-binding")
- .property("vpn-id", "addKey")
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/addKey")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v1")
- .addV()
- .property("aai-node-type", "vpn-binding")
- .property("vpn-id", "modifyKey")
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/modifyKey")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v2")
- .addV()
- .property("aai-node-type", "route-target")
- .property("global-route-target", "modifyTargetKey")
- .property("route-target-role", "modifyRoleKey")
- .property("linked", true)
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/modifyKey/route-targets/route-target/modifyTargetKey/modifyRoleKey")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v3")
- .addE("org.onap.relationships.inventory.BelongsTo").to("v2").from("v3")
- .property(EdgeProperty.CONTAINS.toString(), true)
- .addV()
- .property("aai-node-type", "vpn-binding")
- .property("vpn-id", "deleteKey")
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/deleteKey")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v4")
- .addV()
- .property("aai-node-type", "route-target")
- .property("global-route-target", "deleteTargetKey")
- .property("route-target-role", "deleteRoleKey")
- .property("linked", true)
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/deleteKey/route-targets/route-target/deleteTargetKey/deleteRoleKey")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v5")
- .addE("org.onap.relationships.inventory.BelongsTo").to("v4").from("v5")
- .property(EdgeProperty.CONTAINS.toString(), true)
- .addV()
- .property("aai-node-type", "vpn-binding")
- .property("vpn-id", "getKey")
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/getKey")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v6")
- .addV()
- .property("aai-node-type", "route-target")
- .property("global-route-target", "getTargetKey")
- .property("route-target-role", "getRoleKey")
- .property("linked", true)
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/getKey/route-targets/route-target/getTargetKeyNoLink/getRoleKeyNoLink")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v7")
- .addE("org.onap.relationships.inventory.BelongsTo").to("v6").from("v7")
- .property(EdgeProperty.CONTAINS.toString(), true)
- .addV()
- .property("aai-node-type", "vpn-binding")
- .property("vpn-id", "getKeyNoLink")
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/getKeyNoLink")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v8")
- .addV()
- .property("aai-node-type", "route-target")
- .property("global-route-target", "getTargetKeyNoLink")
- .property("route-target-role", "getRoleKeyNoLink")
- .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/getKeyNoLink/route-targets/route-target/getTargetKeyNoLink/getRoleKeyNoLink")
- .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString())
- .property(AAIProperties.CREATED_TS, 123)
- .property(AAIProperties.SOURCE_OF_TRUTH, "sot")
- .property(AAIProperties.RESOURCE_VERSION, "123")
- .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot")
- .property(AAIProperties.LAST_MOD_TS, 333)
- .as("v9")
- .addE("org.onap.relationships.inventory.BelongsTo").to("v8").from("v9")
- .property(EdgeProperty.CONTAINS.toString(), true)
- .next();
+ graph.traversal().addV().property("aai-node-type", "vpn-binding").property("vpn-id", "addKey")
+ .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/addKey")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v1").addV().property("aai-node-type", "vpn-binding").property("vpn-id", "modifyKey")
+ .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/modifyKey")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v2").addV().property("aai-node-type", "route-target")
+ .property("global-route-target", "modifyTargetKey").property("route-target-role", "modifyRoleKey")
+ .property("linked", true)
+ .property(AAIProperties.AAI_URI,
+ "/network/vpn-bindings/vpn-binding/modifyKey/route-targets/route-target/modifyTargetKey/modifyRoleKey")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v3").addE("org.onap.relationships.inventory.BelongsTo").to("v2").from("v3")
+ .property(EdgeProperty.CONTAINS.toString(), true).addV().property("aai-node-type", "vpn-binding")
+ .property("vpn-id", "deleteKey")
+ .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/deleteKey")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v4").addV().property("aai-node-type", "route-target")
+ .property("global-route-target", "deleteTargetKey").property("route-target-role", "deleteRoleKey")
+ .property("linked", true)
+ .property(AAIProperties.AAI_URI,
+ "/network/vpn-bindings/vpn-binding/deleteKey/route-targets/route-target/deleteTargetKey/deleteRoleKey")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v5").addE("org.onap.relationships.inventory.BelongsTo").to("v4").from("v5")
+ .property(EdgeProperty.CONTAINS.toString(), true).addV().property("aai-node-type", "vpn-binding")
+ .property("vpn-id", "getKey")
+ .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/getKey")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v6").addV().property("aai-node-type", "route-target")
+ .property("global-route-target", "getTargetKey").property("route-target-role", "getRoleKey")
+ .property("linked", true)
+ .property(AAIProperties.AAI_URI,
+ "/network/vpn-bindings/vpn-binding/getKey/route-targets/route-target/getTargetKeyNoLink/getRoleKeyNoLink")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v7").addE("org.onap.relationships.inventory.BelongsTo").to("v6").from("v7")
+ .property(EdgeProperty.CONTAINS.toString(), true).addV().property("aai-node-type", "vpn-binding")
+ .property("vpn-id", "getKeyNoLink")
+ .property(AAIProperties.AAI_URI, "/network/vpn-bindings/vpn-binding/getKeyNoLink")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v8").addV().property("aai-node-type", "route-target")
+ .property("global-route-target", "getTargetKeyNoLink").property("route-target-role", "getRoleKeyNoLink")
+ .property(AAIProperties.AAI_URI,
+ "/network/vpn-bindings/vpn-binding/getKeyNoLink/route-targets/route-target/getTargetKeyNoLink/getRoleKeyNoLink")
+ .property(AAIProperties.AAI_UUID, UUID.randomUUID().toString()).property(AAIProperties.CREATED_TS, 123)
+ .property(AAIProperties.SOURCE_OF_TRUTH, "sot").property(AAIProperties.RESOURCE_VERSION, "123")
+ .property(AAIProperties.LAST_MOD_SOURCE_OF_TRUTH, "lmsot").property(AAIProperties.LAST_MOD_TS, 333)
+ .as("v9").addE("org.onap.relationships.inventory.BelongsTo").to("v8").from("v9")
+ .property(EdgeProperty.CONTAINS.toString(), true).next();
graph.tx().commit();
}
@@ -282,41 +230,21 @@ public class DataLinkTest extends DataLinkSetup {
runner.execute(obj, self);
assertThat("new route-target vertex found with/or without link",
- traversal.V()
- .has(AAIProperties.NODE_TYPE, "route-target")
- .has("global-route-target", "modifyTargetKey2")
- .has("route-target-role", "modifyRoleKey2")
+ traversal.V().has(AAIProperties.NODE_TYPE, "route-target")
+ .has("global-route-target", "modifyTargetKey2").has("route-target-role", "modifyRoleKey2")
.hasNext(),
is(true));
- assertThat("new route-target vertex has link",
- traversal.V()
- .has(AAIProperties.NODE_TYPE, "route-target")
- .has("global-route-target", "modifyTargetKey2")
- .has("route-target-role", "modifyRoleKey2")
- .has("linked", true)
- .hasNext(),
- is(true));
- assertThat("previous vertex still exists",
- traversal.V()
- .has(AAIProperties.NODE_TYPE, "route-target")
- .has("global-route-target", "modifyTargetKey")
- .has("route-target-role", "modifyRoleKey")
- .hasNext(),
+ assertThat("new route-target vertex found",
+ traversal.V().has(AAIProperties.NODE_TYPE, "route-target")
+ .has("global-route-target", "modifyTargetKey2").has("route-target-role", "modifyRoleKey2")
+ .has("linked", true).hasNext(),
is(true));
- assertThat("link of previous vert removed",
- traversal.V()
- .has(AAIProperties.NODE_TYPE, "route-target")
- .has("global-route-target", "modifyTargetKey")
- .has("route-target-role", "modifyRoleKey")
- .has("linked")
- .hasNext(),
+ assertThat("previous link removed",
+ traversal.V().has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "modifyTargetKey")
+ .has("route-target-role", "modifyRoleKey").has("linked").hasNext(),
is(not(true)));
- assertThat("previous vertex still exists",
- traversal.V()
- .has(AAIProperties.NODE_TYPE, "route-target")
- .has("global-route-target", "modifyTargetKey")
- .has("route-target-role", "modifyRoleKey")
- .hasNext(),
+ assertThat("previous vertex still exists", traversal.V().has(AAIProperties.NODE_TYPE, "route-target")
+ .has("global-route-target", "modifyTargetKey").has("route-target-role", "modifyRoleKey").hasNext(),
is(true));
g.tx().rollback();
@@ -346,14 +274,11 @@ public class DataLinkTest extends DataLinkSetup {
runner.execute(obj, self);
assertFalse("route-target vertex not found",
- traversal.V()
- .has(AAIProperties.NODE_TYPE, "route-target")
- .has("global-route-target", "deleteTargetKey")
- .has("route-target-role", "deleteRoleKey")
- .has("linked", true)
- .hasNext());
+ traversal.V().has(AAIProperties.NODE_TYPE, "route-target").has("global-route-target", "deleteTargetKey")
+ .has("route-target-role", "deleteRoleKey").has("linked", true).hasNext());
g.tx().rollback();
+
}
@Test
@@ -382,6 +307,7 @@ public class DataLinkTest extends DataLinkSetup {
obj.getValue("global-route-target").equals("getTargetKey")
&& obj.getValue("route-target-role").equals("getRoleKey"));
g.tx().rollback();
+
}
@Test
@@ -424,5 +350,6 @@ public class DataLinkTest extends DataLinkSetup {
routeTargetTwoV.property(AAIProperties.LINKED).orElse(false));
g.tx().rollback();
+
}
}