Update tinkerpop to 3.2.4
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / introspection / sideeffect / DataLinkTest.java
index cec342e..7ccf130 100644 (file)
 package org.onap.aai.introspection.sideeffect;
 
 import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
+import static org.hamcrest.Matchers.is;
+import static org.hamcrest.Matchers.not;
 import static org.junit.Assert.*;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
 import java.io.UnsupportedEncodingException;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
+import java.net.URI;
 import java.net.URISyntaxException;
 import java.util.Arrays;
 import java.util.Collection;
-import java.util.Iterator;
 import java.util.List;
+import java.util.UUID;
 
+import javax.ws.rs.core.MultivaluedMap;
+
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
-import org.apache.tinkerpop.gremlin.structure.Direction;
-import org.apache.tinkerpop.gremlin.structure.Edge;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 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.Cardinality;
 import org.janusgraph.core.JanusGraph;
 import org.janusgraph.core.JanusGraphFactory;
+import org.janusgraph.core.schema.JanusGraphManagement;
 import org.junit.*;
+import org.junit.experimental.categories.Category;
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
 import org.junit.runners.Parameterized;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
-import org.onap.aai.AAISetup;
 import org.onap.aai.DataLinkSetup;
+import org.onap.aai.TinkerpopUpgrade;
 import org.onap.aai.db.props.AAIProperties;
-import org.onap.aai.dbmap.DBConnectionType;
 import org.onap.aai.edges.enums.EdgeProperty;
 import org.onap.aai.exceptions.AAIException;
-import org.onap.aai.introspection.*;
+import org.onap.aai.introspection.Introspector;
+import org.onap.aai.introspection.Loader;
+import org.onap.aai.introspection.LoaderUtil;
+import org.onap.aai.introspection.ModelType;
+import org.onap.aai.introspection.exceptions.AAIUnknownObjectException;
 import org.onap.aai.parsers.query.QueryParser;
+import org.onap.aai.query.builder.QueryBuilder;
+import org.onap.aai.query.builder.TraversalQuery;
+import org.onap.aai.restcore.util.URITools;
 import org.onap.aai.serialization.db.DBSerializer;
 import org.onap.aai.serialization.engines.JanusGraphDBEngine;
 import org.onap.aai.serialization.engines.QueryStyle;
 import org.onap.aai.serialization.engines.TransactionalGraphEngine;
 
+@Category(TinkerpopUpgrade.class)
 @RunWith(value = Parameterized.class)
 public class DataLinkTest extends DataLinkSetup {
 
     private static JanusGraph graph;
     private final static ModelType introspectorFactoryType = ModelType.MOXY;
-    private final static DBConnectionType type = DBConnectionType.REALTIME;
     private static Loader loader;
     private static TransactionalGraphEngine dbEngine;
     @Mock
@@ -79,59 +90,88 @@ public class DataLinkTest extends DataLinkSetup {
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
-    @Parameterized.Parameter(value = 0)
+    @Parameterized.Parameter
     public QueryStyle queryStyle;
 
     @Parameterized.Parameters(name = "QueryStyle.{0}")
     public static Collection<Object[]> data() {
-        return Arrays.asList(new Object[][] {{QueryStyle.TRAVERSAL}, {QueryStyle.TRAVERSAL_URI}});
+        return Arrays.asList(new Object[][] {{QueryStyle.TRAVERSAL}});
     }
 
     @BeforeClass
-    public static void setup() throws NoSuchFieldException, SecurityException, Exception {
+    public static void setup() {
         graph = JanusGraphFactory.build().set("storage.backend", "inmemory").open();
-
-        graph.traversal()
-                .addV("aai-node-type", "vpn-binding", "vpn-id", "addKey", AAIProperties.AAI_URI,
-                        "/network/vpn-bindings/vpn-binding/addKey")
-                .as("v1")
-                .addV("aai-node-type", "vpn-binding", "vpn-id", "modifyKey", AAIProperties.AAI_URI,
-                        "/network/vpn-bindings/vpn-binding/modifyKey")
-                .as("v2")
-                .addV("aai-node-type", "route-target", "global-route-target", "modifyTargetKey", "route-target-role",
-                        "modifyRoleKey", "linked", true, AAIProperties.AAI_URI,
+        JanusGraphManagement graphMgt = graph.openManagement();
+        graphMgt.makePropertyKey(AAIProperties.CREATED_TS).dataType(Long.class).cardinality(Cardinality.SINGLE).make();
+        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")
-                .addOutE("org.onap.relationships.inventory.BelongsTo", "v2", EdgeProperty.CONTAINS.toString(), true)
-                .addV("aai-node-type", "vpn-binding", "vpn-id", "deleteKey", AAIProperties.AAI_URI,
-                        "/network/vpn-bindings/vpn-binding/deleteKey")
-                .as("v3")
-                .addV("aai-node-type", "route-target", "global-route-target", "deleteTargetKey", "route-target-role",
-                        "deleteRoleKey", "linked", true, AAIProperties.AAI_URI,
+                .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")
-                .addOutE("org.onap.relationships.inventory.BelongsTo", "v3", EdgeProperty.CONTAINS.toString(), true)
-                .addV("aai-node-type", "vpn-binding", "vpn-id", "getKey", AAIProperties.AAI_URI,
-                        "/network/vpn-bindings/vpn-binding/getKey")
-                .as("v4")
-                .addV("aai-node-type", "route-target", "global-route-target", "getTargetKey", "route-target-role",
-                        "getRoleKey", "linked", true, AAIProperties.AAI_URI,
+                .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")
-                .addOutE("org.onap.relationships.inventory.BelongsTo", "v4", EdgeProperty.CONTAINS.toString(), true)
-                .addV("aai-node-type", "vpn-binding", "vpn-id", "getKeyNoLink", AAIProperties.AAI_URI,
-                        "/network/vpn-bindings/vpn-binding/getKeyNoLink")
-                .as("v5")
-                .addV("aai-node-type", "route-target", "global-route-target", "getTargetKeyNoLink", "route-target-role",
-                        "getRoleKeyNoLink", AAIProperties.AAI_URI,
+                .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")
-                .addOutE("org.onap.relationships.inventory.BelongsTo", "v5", EdgeProperty.CONTAINS.toString(), true)
-                .next();
+                .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();
 
-        /*
-         * Commented for SysOut issues
-         */
-        // graph.traversal().V().has("aai-uri","/network/vpn-bindings/vpn-binding/deleteKey").properties().forEachRemaining(p->System.out.println(p.key()
-        // +" : " + p.value()));
-
     }
 
     @AfterClass
@@ -143,14 +183,13 @@ public class DataLinkTest extends DataLinkSetup {
     @Before
     public void initMock() {
         loader = loaderFactory.createLoaderForVersion(introspectorFactoryType, schemaVersions.getDefaultVersion());
-        MockitoAnnotations.initMocks(this);
-        dbEngine = new JanusGraphDBEngine(queryStyle, type, loader);
+        MockitoAnnotations.openMocks(this);
+        dbEngine = new JanusGraphDBEngine(queryStyle, loader);
     }
 
     @Test
-    public void verifyCreationOfVertex() throws URISyntaxException, AAIException, UnsupportedEncodingException,
-            IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException,
-            InstantiationException, NoSuchMethodException, MalformedURLException {
+    public void verifyCreationOfVertex()
+            throws AAIException, UnsupportedEncodingException, IllegalArgumentException, SecurityException {
 
         final Loader loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDepthVersion());
         final Introspector obj = loader.introspectorFromName("vpn-binding");
@@ -161,25 +200,6 @@ public class DataLinkTest extends DataLinkSetup {
         TransactionalGraphEngine.Admin adminSpy = spy(dbEngine.asAdmin());
         Graph g = graph.newTransaction();
         GraphTraversalSource traversal = g.traversal();
-        // Graph g = graph.newTransaction();
-        // GraphTraversalSource traversal = g;
-        // System.out.println("Begin method inventory:");
-        Iterator<Vertex> vertexItr = traversal.V();
-        while (vertexItr != null && vertexItr.hasNext()) {
-            Vertex v = vertexItr.next();
-            // System.out.println("\nnodeType="+v.<String>property("aai-node-type"));
-            for (String key : v.keys()) {
-                // System.out.println("label="+v.label()+";key= "+key+";value= "+v.value(key)+";id= "+v.id());
-            }
-            Direction d = null;
-            Iterator<Edge> edgeItr = v.edges(Direction.BOTH);
-            while (edgeItr != null && edgeItr.hasNext()) {
-                Edge e = edgeItr.next();
-                // System.out.println("outV="+e.outVertex().property(AAIProperties.NODE_TYPE)+"/"+e.outVertex().id()+";inV=
-                // "+e.inVertex().property(AAIProperties.NODE_TYPE)+"/"+e.inVertex().id());
-            }
-        }
-        // System.out.println("End method inventory:");
         when(spy.asAdmin()).thenReturn(adminSpy);
         when(adminSpy.getTraversalSource()).thenReturn(traversal);
         when(spy.tx()).thenReturn(g);
@@ -192,16 +212,52 @@ public class DataLinkTest extends DataLinkSetup {
 
         runner.execute(obj, self);
 
-        assertEquals("route-target vertex found", true, traversal.V().has(AAIProperties.NODE_TYPE, "route-target")
+        assertTrue("route-target vertex found", traversal.V().has(AAIProperties.NODE_TYPE, "route-target")
                 .has("global-route-target", "key1").has("route-target-role", "key2").has("linked", true).hasNext());
         g.tx().rollback();
 
     }
 
+    /** 
+     * This is more directly testing the modification mechanism (see verifyModificationOfVertex test)
+     */
     @Test
-    public void verifyModificationOfVertex() throws URISyntaxException, AAIException, UnsupportedEncodingException,
-            IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException,
-            InstantiationException, NoSuchMethodException, MalformedURLException {
+    public void linkQuery() throws UnsupportedEncodingException, AAIException, URISyntaxException {
+        Graph g = graph.newTransaction();
+        GraphTraversalSource source = g.traversal();
+        final Loader loader = LoaderUtil.getLatestVersion();
+        URI uri = new URI("/network/vpn-bindings/vpn-binding/modifyKey/route-targets/route-target/modifyTargetKey2/modifyRoleKey2");
+        MultivaluedMap<String, String> map = URITools.getQueryMap(uri);
+        GraphTraversal<Vertex, Vertex> traversal = __.<Vertex>start();
+        
+        QueryParser uriQuery = dbEngine.getQueryBuilder(this.queryStyle, loader, source, traversal).createQueryFromURI(uri, map);
+        // assertEquals(6, traversal.asAdmin().getSteps().size());
+        // assertEquals("HasStep([vpn-id.eq(modifyKey)])", traversal.asAdmin().getSteps().get(0).toString());
+        // assertEquals("HasStep([aai-node-type.eq(vpn-binding)])", traversal.asAdmin().getSteps().get(1).toString());
+        // assertEquals("VertexStep(IN,[org.onap.relationships.inventory.BelongsTo],vertex)", traversal.asAdmin().getSteps().get(2).toString());
+        // assertEquals("HasStep([aai-node-type.eq(route-target)])", traversal.asAdmin().getSteps().get(3).toString());
+        // assertEquals("HasStep([global-route-target.eq(modifyTargetKey2)])", traversal.asAdmin().getSteps().get(4).toString());
+        // assertEquals("HasStep([route-target-role.eq(modifyRoleKey2)])", traversal.asAdmin().getSteps().get(5).toString());
+        List<Vertex> results = uriQuery.getQueryBuilder().toList();
+
+        assertEquals(0, results.size());
+        // assertEquals(traversal.asAdmin().getSteps().size(), 6);
+        // assertEquals("HasStep([vpn-id.eq(modifyKey)])", traversal.asAdmin().getSteps().get(0).toString());
+        // assertEquals("HasStep([aai-node-type.eq(vpn-binding)])", traversal.asAdmin().getSteps().get(1).toString());
+        // assertEquals("VertexStep(IN,[org.onap.relationships.inventory.BelongsTo],vertex)", traversal.asAdmin().getSteps().get(2).toString());
+        // assertEquals("HasStep([aai-node-type.eq(route-target)])", traversal.asAdmin().getSteps().get(3).toString());
+        // assertEquals("HasStep([global-route-target.eq(modifyTargetKey2)])", traversal.asAdmin().getSteps().get(4).toString());
+        // assertEquals("HasStep([route-target-role.eq(modifyRoleKey2)])", traversal.asAdmin().getSteps().get(5).toString());
+
+        QueryBuilder<Vertex> queryBuilder = uriQuery.getQueryBuilder().getContainerQuery()
+        .getVerticesByProperty(AAIProperties.LINKED, true);
+        List<Vertex> linkedVertices = queryBuilder.toList();
+        assertEquals(1, linkedVertices.size());
+    }
+
+    @Test
+    public void verifyModificationOfVertex()
+            throws AAIException, UnsupportedEncodingException, IllegalArgumentException, SecurityException {
 
         final Loader loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDepthVersion());
         final Introspector obj = loader.introspectorFromName("vpn-binding");
@@ -210,30 +266,11 @@ public class DataLinkTest extends DataLinkSetup {
         obj.setValue("route-target-role", "modifyRoleKey2");
         TransactionalGraphEngine spy = spy(dbEngine);
         TransactionalGraphEngine.Admin adminSpy = spy(dbEngine.asAdmin());
-        // Graph g = graph.newTransaction();
-        // GraphTraversalSource traversal = g;
         Graph g = graph.newTransaction();
         GraphTraversalSource traversal = g.traversal();
-        Iterator<Vertex> vertexItr = traversal.V();
-        while (vertexItr != null && vertexItr.hasNext()) {
-            Vertex v = vertexItr.next();
-            // System.out.println("\nnodeType="+v.<String>property("aai-node-type"));
-            for (String key : v.keys()) {
-                // System.out.println("label="+v.label()+";key= "+key+";value= "+v.value(key)+"/"+v.id());
-            }
-            Direction d = null;
-            Iterator<Edge> edgeItr = v.edges(Direction.BOTH);
-            while (edgeItr != null && edgeItr.hasNext()) {
-                Edge e = edgeItr.next();
-                // System.out.println("outV="+e.outVertex().property(AAIProperties.NODE_TYPE)+"/"+e.outVertex().id()+";inV=
-                // "+e.inVertex().property(AAIProperties.NODE_TYPE)+"/"+e.inVertex().id());
-            }
-        }
-        // System.out.println("End method inventory:");
 
         when(spy.asAdmin()).thenReturn(adminSpy);
         when(adminSpy.getTraversalSource()).thenReturn(traversal);
-        // when(spy.tx()).thenReturn(graph);
         when(spy.tx()).thenReturn(g);
         when(self.<String>property(AAIProperties.AAI_URI)).thenReturn(prop);
         when(prop.orElse(null)).thenReturn(obj.getURI());
@@ -241,44 +278,8 @@ public class DataLinkTest extends DataLinkSetup {
                 new DBSerializer(schemaVersions.getDefaultVersion(), spy, introspectorFactoryType, "AAI_TEST");
         SideEffectRunner runner =
                 new SideEffectRunner.Builder(spy, serializer).addSideEffect(DataLinkWriter.class).build();
-        // System.out.println("Traversal Source: "+traversal.toString());
-        vertexItr = traversal.V();
-        // System.out.println("Begin method inventory:");
-        while (vertexItr != null && vertexItr.hasNext()) {
-            Vertex v = vertexItr.next();
-            // System.out.println("\nnodeType="+v.<String>property("aai-node-type"));
-            for (String key : v.keys()) {
-                // System.out.println("label="+v.label()+";key= "+key+";value= "+v.value(key)+"/"+v.id());
-            }
-            Iterator<Edge> edgeItr = v.edges(Direction.BOTH);
-            while (edgeItr != null && edgeItr.hasNext()) {
-                Edge e = edgeItr.next();
-                // System.out.println("outV="+e.outVertex().property(AAIProperties.NODE_TYPE)+"/"+e.outVertex().id()+";inV=
-                // "+e.inVertex().property(AAIProperties.NODE_TYPE)+"/"+e.inVertex().id());
-            }
-        }
-        // System.out.println("End method inventory:");
-        try {
-            runner.execute(obj, self);
-        } catch (Exception e) {
-
-        }
-        // runner.execute(obj, self);
-        // System.out.println("=================\n");
-        vertexItr = traversal.V();
-        while (vertexItr != null && vertexItr.hasNext()) {
-            Vertex v = vertexItr.next();
-            // System.out.println("\nnodeType="+v.<String>property("aai-node-type"));
-            for (String key : v.keys()) {
-                // System.out.println("label="+v.label()+";key= "+key+";value= "+v.value(key)+"/"+v.id());
-            }
-            Iterator<Edge> edgeItr = v.edges(Direction.BOTH);
-            while (edgeItr != null && edgeItr.hasNext()) {
-                Edge e = edgeItr.next();
-                // System.out.println("outV="+e.outVertex().property(AAIProperties.NODE_TYPE)+"/"+e.outVertex().id()+";inV=
-                // "+e.inVertex().property(AAIProperties.NODE_TYPE)+"/"+e.inVertex().id());
-            }
-        }
+        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")
@@ -301,9 +302,7 @@ public class DataLinkTest extends DataLinkSetup {
     }
 
     @Test
-    public void verifyDeleteOfVertex() throws URISyntaxException, AAIException, UnsupportedEncodingException,
-            IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException,
-            InstantiationException, NoSuchMethodException, MalformedURLException {
+    public void verifyDeleteOfVertex() throws Exception {
 
         final Loader loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDepthVersion());
         final Introspector obj = loader.introspectorFromName("vpn-binding");
@@ -325,7 +324,7 @@ public class DataLinkTest extends DataLinkSetup {
 
         runner.execute(obj, self);
 
-        assertEquals("route-target vertex not found", false,
+        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());
 
@@ -334,9 +333,7 @@ public class DataLinkTest extends DataLinkSetup {
     }
 
     @Test
-    public void verifyPropertyPopulation() throws URISyntaxException, AAIException, UnsupportedEncodingException,
-            IllegalAccessException, IllegalArgumentException, InvocationTargetException, SecurityException,
-            InstantiationException, NoSuchMethodException, MalformedURLException {
+    public void verifyPropertyPopulation() throws Exception {
 
         final Loader loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDepthVersion());
         final Introspector obj = loader.introspectorFromName("vpn-binding");
@@ -357,7 +354,7 @@ public class DataLinkTest extends DataLinkSetup {
 
         runner.execute(obj, self);
 
-        assertEquals("both properties have been populated in target object", true,
+        assertTrue("both properties have been populated in target object",
                 obj.getValue("global-route-target").equals("getTargetKey")
                         && obj.getValue("route-target-role").equals("getRoleKey"));
         g.tx().rollback();
@@ -365,9 +362,8 @@ public class DataLinkTest extends DataLinkSetup {
     }
 
     @Test
-    public void verifyPropertyPopulationWithV10OnlyPut() throws URISyntaxException, AAIException,
-            UnsupportedEncodingException, IllegalAccessException, IllegalArgumentException, InvocationTargetException,
-            SecurityException, InstantiationException, NoSuchMethodException, MalformedURLException {
+    public void verifyPropertyPopulationWithV10OnlyPut()
+            throws AAIException, UnsupportedEncodingException, IllegalArgumentException, SecurityException {
         final Introspector obj = loader.introspectorFromName("vpn-binding");
         obj.setValue("vpn-id", "getKeyNoLink");
         final Introspector routeTargets = loader.introspectorFromName("route-targets");