AAI-1523 Batch reformat aai-core
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / query / builder / QueryBuilderTestAbstraction.java
index b26c0b0..0e52749 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.query.builder;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
+import static org.junit.Assert.*;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.tinkerpop.gremlin.process.traversal.Path;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet;
@@ -32,14 +42,15 @@ import org.junit.runner.RunWith;
 import org.onap.aai.config.ConfigConfiguration;
 import org.onap.aai.config.IntrospectionConfig;
 import org.onap.aai.config.SpringContextAware;
+import org.onap.aai.db.props.AAIProperties;
+import org.onap.aai.edges.EdgeIngestor;
+import org.onap.aai.edges.enums.EdgeType;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.introspection.Loader;
 import org.onap.aai.introspection.LoaderFactory;
 import org.onap.aai.introspection.ModelType;
 import org.onap.aai.nodes.NodeIngestor;
 import org.onap.aai.serialization.db.EdgeSerializer;
-import org.onap.aai.edges.EdgeIngestor;
-import org.onap.aai.edges.enums.EdgeType;
 import org.onap.aai.serialization.db.exceptions.NoEdgeRuleFoundException;
 import org.onap.aai.serialization.queryformats.QueryFormatTestHelper;
 import org.onap.aai.setup.SchemaLocationsBean;
@@ -50,37 +61,18 @@ import org.springframework.test.annotation.DirtiesContext;
 import org.springframework.test.context.ContextConfiguration;
 import org.springframework.test.context.TestPropertySource;
 import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
-import org.onap.aai.db.props.AAIProperties;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.collection.IsIterableContainingInOrder.contains;
-import static org.junit.Assert.*;
 
 @RunWith(SpringJUnit4ClassRunner.class)
-@ContextConfiguration(classes = {
-        ConfigConfiguration.class,
-        QueryTestsConfigTranslator.class,
-        NodeIngestor.class,
-        EdgeIngestor.class,
-        EdgeSerializer.class,
-        SpringContextAware.class,
-        IntrospectionConfig.class
-})
+@ContextConfiguration(
+        classes = {ConfigConfiguration.class, QueryTestsConfigTranslator.class, NodeIngestor.class, EdgeIngestor.class,
+                EdgeSerializer.class, SpringContextAware.class, IntrospectionConfig.class})
 @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_CLASS)
-@TestPropertySource(properties = {
-    "schema.translator.list = config",
-    "schema.nodes.location=src/test/resources/onap/oxm",
-    "schema.edges.location=src/test/resources/onap/dbedgerules"
-})
+@TestPropertySource(
+        properties = {"schema.translator.list = config", "schema.nodes.location=src/test/resources/onap/oxm",
+                "schema.edges.location=src/test/resources/onap/dbedgerules"})
 public abstract class QueryBuilderTestAbstraction {
 
-    protected   Loader loader;
+    protected Loader loader;
     protected static Graph graph;
     protected GraphTraversalSource g;
 
@@ -93,12 +85,12 @@ public abstract class QueryBuilderTestAbstraction {
     @Autowired
     protected LoaderFactory loaderFactory;
 
-
     @BeforeClass
     public static void setup() throws Exception {
         System.setProperty("AJSC_HOME", ".");
         System.setProperty("BUNDLECONFIG_DIR", "src/test/resources/bundleconfig-local");
-        QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"), "src/test/resources/bundleconfig-local/etc/oxm/");
+        QueryFormatTestHelper.setFinalStatic(AAIConstants.class.getField("AAI_HOME_ETC_OXM"),
+                "src/test/resources/bundleconfig-local/etc/oxm/");
         graph = JanusGraphFactory.build().set("storage.backend", "inmemory").open();
     }
 
@@ -106,7 +98,6 @@ public abstract class QueryBuilderTestAbstraction {
     public void configure() throws Exception {
         loader = loaderFactory.createLoaderForVersion(ModelType.MOXY, schemaVersions.getDefaultVersion());
 
-
         g = graph.traversal();
     }
 
@@ -123,8 +114,8 @@ public abstract class QueryBuilderTestAbstraction {
     @Test
     public void createEdgeGVnfToVnfcTraversal() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","myvnf").next();
-        Vertex vnfc = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "myvnf").next();
+        Vertex vnfc = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
         testEdgeSer.addEdge(g, gvnf, vnfc, "uses");
 
         QueryBuilder<Vertex> tQ = getNewVertexTraversalWithTestEdgeRules(gvnf);
@@ -132,14 +123,13 @@ public abstract class QueryBuilderTestAbstraction {
 
         assertEquals(vnfc, tQ.next());
 
-
     }
 
     @Test
     public void createEdgeLinterfaceToLogicalLinkTraversal() throws AAIException {
 
-        Vertex lInterface = g.addV("aai-node-type","l-interface","interface-name","l-interface-a").next();
-        Vertex logicalLink = g.addV("aai-node-type","logical-link","link-name","logical-link-a").next();
+        Vertex lInterface = g.addV("aai-node-type", "l-interface", "interface-name", "l-interface-a").next();
+        Vertex logicalLink = g.addV("aai-node-type", "logical-link", "link-name", "logical-link-a").next();
         testEdgeSer.addEdge(g, lInterface, logicalLink, "sourceLInterface");
 
         QueryBuilder<Vertex> tQ = getNewVertexTraversalWithTestEdgeRules(lInterface);
@@ -149,21 +139,22 @@ public abstract class QueryBuilderTestAbstraction {
 
         assertEquals(logicalLink, next);
 
-
     }
 
     @SuppressWarnings("rawtypes")
     @Test
     public void createEdgeLinterfaceToLogicalLinkTraversal_tree() throws AAIException {
-        Vertex lInterface = g.addV("aai-node-type","l-interface","interface-name","l-interface-a").next();
-        Vertex logicalLink = g.addV("aai-node-type","logical-link","link-name","logical-link-a").next();
+        Vertex lInterface = g.addV("aai-node-type", "l-interface", "interface-name", "l-interface-a").next();
+        Vertex logicalLink = g.addV("aai-node-type", "logical-link", "link-name", "logical-link-a").next();
         testEdgeSer.addEdge(g, lInterface, logicalLink, "sourceLInterface");
 
         QueryBuilder<Tree> tQ = getNewTreeTraversalWithTestEdgeRules(lInterface).createEdgeTraversal(EdgeType.COUSIN,
-                loader.introspectorFromName("l-interface" ), loader.introspectorFromName("logical-link")).tree();
+                loader.introspectorFromName("l-interface"), loader.introspectorFromName("logical-link")).tree();
 
-        Vertex lInterfaceExpected = graph.traversal().V().has("aai-node-type","l-interface").has("interface-name","l-interface-a").next();
-        Vertex logicalLinkExpected = graph.traversal().V().has("aai-node-type", "logical-link").has("link-name","logical-link-a").next();
+        Vertex lInterfaceExpected =
+                graph.traversal().V().has("aai-node-type", "l-interface").has("interface-name", "l-interface-a").next();
+        Vertex logicalLinkExpected =
+                graph.traversal().V().has("aai-node-type", "logical-link").has("link-name", "logical-link-a").next();
         Tree tree = tQ.next();
         assertTrue(tree.containsKey(lInterfaceExpected));
         assertTrue(((Tree) tree.get(lInterfaceExpected)).containsKey(logicalLinkExpected));
@@ -172,15 +163,18 @@ public abstract class QueryBuilderTestAbstraction {
     @SuppressWarnings("rawtypes")
     @Test
     public void createEdgeLinterfaceToLogicalLinkTraversal_Path() throws AAIException {
-        Vertex pInterface = g.addV("aai-node-type","p-interface","interface-name","p-interface-a").next();
-        Vertex lInterface = g.addV("aai-node-type","l-interface","interface-name","l-interface-a").next();
-        Vertex logicalLink = g.addV("aai-node-type","logical-link","link-name","logical-link-a").next();
+        Vertex pInterface = g.addV("aai-node-type", "p-interface", "interface-name", "p-interface-a").next();
+        Vertex lInterface = g.addV("aai-node-type", "l-interface", "interface-name", "l-interface-a").next();
+        Vertex logicalLink = g.addV("aai-node-type", "logical-link", "link-name", "logical-link-a").next();
         testEdgeSer.addEdge(g, lInterface, logicalLink);
         testEdgeSer.addTreeEdge(g, pInterface, lInterface);
 
-        QueryBuilder<Path> tQ = getNewPathTraversalWithTestEdgeRules(pInterface).createEdgeTraversal(EdgeType.TREE,
-                loader.introspectorFromName("p-interface" ), loader.introspectorFromName("l-interface")).createEdgeTraversal(EdgeType.COUSIN,
-                loader.introspectorFromName("l-interface" ), loader.introspectorFromName("logical-link")).path();
+        QueryBuilder<Path> tQ = getNewPathTraversalWithTestEdgeRules(pInterface)
+                .createEdgeTraversal(EdgeType.TREE, loader.introspectorFromName("p-interface"),
+                        loader.introspectorFromName("l-interface"))
+                .createEdgeTraversal(EdgeType.COUSIN, loader.introspectorFromName("l-interface"),
+                        loader.introspectorFromName("logical-link"))
+                .path();
 
         Path path = tQ.next();
         assertThat(path.objects(), contains(pInterface, lInterface, logicalLink));
@@ -189,8 +183,8 @@ public abstract class QueryBuilderTestAbstraction {
     @SuppressWarnings("rawtypes")
     @Test
     public void parentVertexTest() throws AAIException {
-        Vertex pInterface = g.addV("aai-node-type","p-interface","interface-name","p-interface-a").next();
-        Vertex lInterface = g.addV("aai-node-type","l-interface","interface-name","l-interface-a").next();
+        Vertex pInterface = g.addV("aai-node-type", "p-interface", "interface-name", "p-interface-a").next();
+        Vertex lInterface = g.addV("aai-node-type", "l-interface", "interface-name", "l-interface-a").next();
 
         testEdgeSer.addTreeEdge(g, pInterface, lInterface);
 
@@ -200,29 +194,28 @@ public abstract class QueryBuilderTestAbstraction {
         assertThat(parent, is(pInterface));
     }
 
-
     @Test
     public void createEdgeLinterfaceToLogicalLinkIntrospectorTraversal() throws AAIException {
 
-        Vertex lInterface = g.addV("aai-node-type","l-interface","interface-name","l-interface-a").next();
-        Vertex logicalLink = g.addV("aai-node-type","logical-link","link-name","logical-link-a").next();
+        Vertex lInterface = g.addV("aai-node-type", "l-interface", "interface-name", "l-interface-a").next();
+        Vertex logicalLink = g.addV("aai-node-type", "logical-link", "link-name", "logical-link-a").next();
         testEdgeSer.addEdge(g, lInterface, logicalLink, "sourceLInterface");
 
         QueryBuilder<Vertex> tQ = getNewVertexTraversalWithTestEdgeRules(lInterface);
-        tQ.createEdgeTraversal(EdgeType.COUSIN, loader.introspectorFromName("l-interface"), loader.introspectorFromName("logical-link"));
+        tQ.createEdgeTraversal(EdgeType.COUSIN, loader.introspectorFromName("l-interface"),
+                loader.introspectorFromName("logical-link"));
 
         Vertex next = tQ.next();
 
         assertEquals(logicalLink, next);
 
-
     }
 
     @Test
     public void createEdgeLinterfaceToLogicalLinkVertexToIntrospectorTraversal() throws AAIException {
 
-        Vertex lInterface = g.addV("aai-node-type","l-interface","interface-name","l-interface-a").next();
-        Vertex logicalLink = g.addV("aai-node-type","logical-link","link-name","logical-link-a").next();
+        Vertex lInterface = g.addV("aai-node-type", "l-interface", "interface-name", "l-interface-a").next();
+        Vertex logicalLink = g.addV("aai-node-type", "logical-link", "link-name", "logical-link-a").next();
         testEdgeSer.addEdge(g, lInterface, logicalLink, "sourceLInterface");
 
         QueryBuilder<Vertex> tQ = getNewVertexTraversalWithTestEdgeRules(lInterface);
@@ -232,14 +225,13 @@ public abstract class QueryBuilderTestAbstraction {
 
         assertEquals(logicalLink, next);
 
-
     }
 
     @Test
     public void edgeToVertexTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex vnfc1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex vnfc1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, vnfc1);
 
@@ -251,14 +243,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("Has 1 vertexes ", 1, list.size());
         assertTrue("Has vertex on the default edge ", list.contains(vnfc1));
 
-
     }
 
     @Test
     public void edgeToVertexTraversalSingleOutRuleTest() throws AAIException {
 
-        Vertex vce = g.addV("aai-node-type","vce","vnf-id","vce").next();
-        Vertex vnfc1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
+        Vertex vce = g.addV("aai-node-type", "vce", "vnf-id", "vce").next();
+        Vertex vnfc1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
 
         testEdgeSer.addEdge(g, vce, vnfc1);
 
@@ -276,14 +267,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("2 - Has 1 vertexes ", 1, list2.size());
         assertTrue("2 - traversal results in vce ", list2.contains(vce));
 
-
     }
 
     @Test
     public void edgeToVertexTraversalSingleInRuleTest() throws AAIException {
 
-        Vertex vce = g.addV("aai-node-type","vce","vnf-id","vce").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex vce = g.addV("aai-node-type", "vce", "vnf-id", "vce").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, vce, pserver);
 
@@ -295,15 +285,14 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("1 - Has 1 vertexes ", 1, list.size());
         assertTrue("1 - traversal results in vnfc ", list.contains(pserver));
 
-
     }
 
     @Test
     public void edgeToVertexMultiRuleTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex vnfc1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
-        Vertex vnfc2 = g.addV("aai-node-type","vnfc","vnfc-name","b-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex vnfc1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
+        Vertex vnfc2 = g.addV("aai-node-type", "vnfc", "vnfc-name", "b-name").next();
 
         testEdgeSer.addEdge(g, gvnf, vnfc1);
         testEdgeSer.addEdge(g, gvnf, vnfc2, "re-uses");
@@ -317,15 +306,14 @@ public abstract class QueryBuilderTestAbstraction {
         assertTrue("Has vertex on the default edge ", list.contains(vnfc1));
         assertTrue("Has vertex on the re-uses edge ", list.contains(vnfc2));
 
-
     }
 
     @Test
     public void edgeToVertexMultiLabelTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
-        Vertex vnfc1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
+        Vertex vnfc1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, vnfc1);
         testEdgeSer.addEdge(g, pserver, vnfc1);
@@ -338,30 +326,28 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("Has 1 vertexes ", 1, list.size());
         assertTrue("Only returns the generic vnf vertex", list.contains(gvnf));
 
-
     }
 
     @Test
     public void limitTraversalTest() throws AAIException {
 
-        g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
-        g.addV("aai-node-type","vnfc","vnfc-name","b-name").next();
+        g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
+        g.addV("aai-node-type", "vnfc", "vnfc-name", "b-name").next();
 
         QueryBuilder<Vertex> tQ = new GremlinTraversal<>(loader, g);
-        tQ.getVerticesByProperty("aai-node-type","vnfc").limit(1);
+        tQ.getVerticesByProperty("aai-node-type", "vnfc").limit(1);
 
         List<Vertex> list = tQ.toList();
 
         assertEquals("Has 1 vertexes ", 1, list.size());
 
-
     }
 
     @Test
     public void getVertexesByPropertiesTraversalTest() throws AAIException {
 
-        g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
-        g.addV("aai-node-type","vnfc","vnfc-name","b-name").next();
+        g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
+        g.addV("aai-node-type", "vnfc", "vnfc-name", "b-name").next();
 
         QueryBuilder<Vertex> tQ = new GremlinTraversal<>(loader, g);
         tQ.getVerticesByProperty("vnfc-name", Arrays.asList("a-name", "b-name"));
@@ -370,30 +356,28 @@ public abstract class QueryBuilderTestAbstraction {
 
         assertEquals("Has 2 vertexes ", 2, list.size());
 
-
     }
 
     @Test
     public void getVertexesByIndexedPropertyTraversalTest() throws AAIException {
 
-        g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
-        g.addV("aai-node-type","vnfc","vnfc-name","b-name").next();
+        g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
+        g.addV("aai-node-type", "vnfc", "vnfc-name", "b-name").next();
 
         QueryBuilder<Vertex> tQ = new GremlinTraversal<>(loader, g);
-        tQ.getVerticesByIndexedProperty("aai-node-type","vnfc");
+        tQ.getVerticesByIndexedProperty("aai-node-type", "vnfc");
 
         List<Vertex> list = tQ.toList();
 
         assertEquals("Has 2 vertexes ", 2, list.size());
 
-
     }
 
     @Test
     public void dedupTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, pserver);
         testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -406,14 +390,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("Has 2 vertexes ", 1, list.size());
         assertTrue("result has pserver ", list.contains(pserver));
 
-
     }
 
     @Test
     public void storeCapTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, pserver);
         testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -424,16 +407,15 @@ public abstract class QueryBuilderTestAbstraction {
         List<BulkSet<Vertex>> list = tQ.toList();
 
         assertEquals("Has 2 vertexes ", 1, list.size());
-        assertEquals("result has pserver ",pserver, list.get(0).iterator().next());
-
+        assertEquals("result has pserver ", pserver, list.get(0).iterator().next());
 
     }
 
     @Test
     public void storeCapUnfoldTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, pserver);
         testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -446,25 +428,24 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("Has 2 vertexes ", 2, list.size());
         assertTrue("result has pserver ", list.contains(pserver));
 
-
     }
 
     @Test
     public void nextAndHasNextTraversalTest() throws AAIException {
 
-        Vertex v1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
-        Vertex v2 = g.addV("aai-node-type","vnfc","vnfc-name","b-name").next();
+        Vertex v1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
+        Vertex v2 = g.addV("aai-node-type", "vnfc", "vnfc-name", "b-name").next();
 
         QueryBuilder<Vertex> tQ = new GremlinTraversal<>(loader, g);
-        tQ.getVerticesByProperty("aai-node-type","vnfc");
+        tQ.getVerticesByProperty("aai-node-type", "vnfc");
 
         List<Vertex> list = new ArrayList<>();
 
-        assertTrue("Has next 1 ",tQ.hasNext());
+        assertTrue("Has next 1 ", tQ.hasNext());
         list.add(tQ.next());
-        assertTrue("Has next 2 ",tQ.hasNext());
+        assertTrue("Has next 2 ", tQ.hasNext());
         list.add(tQ.next());
-        assertFalse("Has next 3 ",tQ.hasNext());
+        assertFalse("Has next 3 ", tQ.hasNext());
         assertTrue("Has all the vertexes", list.contains(v1) && list.remove(v2));
 
     }
@@ -472,8 +453,8 @@ public abstract class QueryBuilderTestAbstraction {
     @Test
     public void edgeToVertexMultiRuleOutTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, pserver);
         testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -486,14 +467,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("Has 2 vertexes ", 2, list.size());
         assertTrue("result has pserver ", list.contains(pserver));
 
-
     }
 
     @Test
     public void edgeToVertexMultiRuleInTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex complex = g.addV("aai-node-type","complex","physical-location-id","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex complex = g.addV("aai-node-type", "complex", "physical-location-id", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, complex);
         testEdgeSer.addEdge(g, gvnf, complex, "complex-generic-vnf-B");
@@ -506,14 +486,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("Has 2 vertexes ", 2, list.size());
         assertTrue("result has pserver ", list.contains(complex));
 
-
     }
 
     @Test
     public void edgeTraversalSingleInRuleTest() throws AAIException {
 
-        Vertex vce = g.addV("aai-node-type","vce","vnf-id","vce").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex vce = g.addV("aai-node-type", "vce", "vnf-id", "vce").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         Edge e = testEdgeSer.addEdge(g, vce, pserver);
 
@@ -525,14 +504,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("1 - Has 1 edge ", 1, list.size());
         assertTrue("1 - traversal results in edge ", list.contains(e));
 
-
     }
 
     @Test
     public void edgeTraversalSingleOutRuleTest() throws AAIException {
 
-        Vertex vce = g.addV("aai-node-type","vce","vnf-id","vce").next();
-        Vertex vnfc1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
+        Vertex vce = g.addV("aai-node-type", "vce", "vnf-id", "vce").next();
+        Vertex vnfc1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
 
         Edge e = testEdgeSer.addEdge(g, vce, vnfc1);
 
@@ -544,14 +522,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertEquals("1 - Has 1 edge ", 1, list1.size());
         assertTrue("1 - traversal results in edge ", list1.contains(e));
 
-
     }
 
     @Test
     public void edgeTraversalMultiRuleOutTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, pserver);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -565,14 +542,13 @@ public abstract class QueryBuilderTestAbstraction {
         assertTrue("result has default edge ", list.contains(e1));
         assertTrue("result has other edge ", list.contains(e2));
 
-
     }
 
     @Test
     public void edgeTraversalMultiRuleInTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex complex = g.addV("aai-node-type","complex","physical-location-id","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex complex = g.addV("aai-node-type", "complex", "physical-location-id", "a-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, complex);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, complex, "complex-generic-vnf-B");
@@ -586,15 +562,14 @@ public abstract class QueryBuilderTestAbstraction {
         assertTrue("result has default edge ", list.contains(e1));
         assertTrue("result has other edge ", list.contains(e2));
 
-
     }
 
     @Test
     public void edgeTraversalMultiRuleTraversalTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex vnfc1 = g.addV("aai-node-type","vnfc","vnfc-name","a-name").next();
-        Vertex vnfc2 = g.addV("aai-node-type","vnfc","vnfc-name","b-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex vnfc1 = g.addV("aai-node-type", "vnfc", "vnfc-name", "a-name").next();
+        Vertex vnfc2 = g.addV("aai-node-type", "vnfc", "vnfc-name", "b-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, vnfc1);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, vnfc2, "re-uses");
@@ -608,15 +583,14 @@ public abstract class QueryBuilderTestAbstraction {
         assertTrue("result has default edge ", list.contains(e1));
         assertTrue("result has other edge ", list.contains(e2));
 
-
     }
 
     @Ignore("This test is failing for TraversalQueryTest and Optimized but it passes for GremlinQueryTest")
-    @Test (expected = NoEdgeRuleFoundException.class)
+    @Test(expected = NoEdgeRuleFoundException.class)
     public void getEdgesBetweenWithLabelsEmptyListTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, pserver);
         testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -629,14 +603,15 @@ public abstract class QueryBuilderTestAbstraction {
     @Test
     public void getEdgesBetweenWithLabelsSingleItemTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, pserver);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
 
         QueryBuilder<Edge> tQ = getNewEdgeTraversalWithTestEdgeRules(gvnf);
-        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver", Collections.singletonList("generic-vnf-pserver-B"));
+        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver",
+                Collections.singletonList("generic-vnf-pserver-B"));
 
         List<Edge> list = tQ.toList();
 
@@ -649,14 +624,15 @@ public abstract class QueryBuilderTestAbstraction {
     @Test
     public void getEdgesBetweenWithLabelsMultipleItemTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, pserver);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
 
         QueryBuilder<Edge> tQ = getNewEdgeTraversalWithTestEdgeRules(gvnf);
-        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver", Arrays.asList("generic-vnf-pserver-B", "generic-vnf-pserver-A"));
+        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver",
+                Arrays.asList("generic-vnf-pserver-B", "generic-vnf-pserver-A"));
 
         List<Edge> list = tQ.toList();
 
@@ -667,7 +643,7 @@ public abstract class QueryBuilderTestAbstraction {
     }
 
     @Ignore("This test is failing for TraversalQueryTest and Optimized but it passes for GremlinQueryTest")
-    @Test (expected = NoEdgeRuleFoundException.class)
+    @Test(expected = NoEdgeRuleFoundException.class)
     public void createEdgeTraversalWithLabelsEmptyListTest() throws AAIException {
 
         Vertex gvnf = getVertex();
@@ -677,12 +653,11 @@ public abstract class QueryBuilderTestAbstraction {
 
         tQ.toList();
 
-
     }
 
     private Vertex getVertex() throws AAIException {
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         testEdgeSer.addEdge(g, gvnf, pserver);
         testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
@@ -692,14 +667,15 @@ public abstract class QueryBuilderTestAbstraction {
     @Test
     public void createEdgeTraversalWithLabelsSingleItemTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, pserver);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
 
         QueryBuilder<Edge> tQ = getNewEdgeTraversalWithTestEdgeRules(gvnf);
-        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver", Collections.singletonList("generic-vnf-pserver-B"));
+        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver",
+                Collections.singletonList("generic-vnf-pserver-B"));
 
         List<Edge> list = tQ.toList();
 
@@ -712,14 +688,15 @@ public abstract class QueryBuilderTestAbstraction {
     @Test
     public void createEdgeTraversalWithLabelsMultipleItemTest() throws AAIException {
 
-        Vertex gvnf = g.addV("aai-node-type","generic-vnf","vnf-id","gvnf").next();
-        Vertex pserver = g.addV("aai-node-type","pserver","hostname","a-name").next();
+        Vertex gvnf = g.addV("aai-node-type", "generic-vnf", "vnf-id", "gvnf").next();
+        Vertex pserver = g.addV("aai-node-type", "pserver", "hostname", "a-name").next();
 
         Edge e1 = testEdgeSer.addEdge(g, gvnf, pserver);
         Edge e2 = testEdgeSer.addEdge(g, gvnf, pserver, "generic-vnf-pserver-B");
 
         QueryBuilder<Edge> tQ = getNewEdgeTraversalWithTestEdgeRules(gvnf);
-        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver", Arrays.asList("generic-vnf-pserver-B", "generic-vnf-pserver-A"));
+        tQ.getEdgesBetweenWithLabels(EdgeType.COUSIN, "generic-vnf", "pserver",
+                Arrays.asList("generic-vnf-pserver-B", "generic-vnf-pserver-A"));
 
         List<Edge> list = tQ.toList();