AAI-1523 Batch reformat aai-core
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / rest / EdgeNotValidAnymoreTest.java
index 1a69fc5..68fae9c 100644 (file)
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.aai.rest;
 
+import static org.hamcrest.CoreMatchers.containsString;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.Matchers.not;
+import static org.junit.Assert.assertThat;
+
+import java.io.IOException;
+import java.util.UUID;
+
+import javax.ws.rs.core.Response;
+
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -37,15 +48,6 @@ import org.onap.aai.edges.enums.EdgeProperty;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.serialization.engines.QueryStyle;
 
-import javax.ws.rs.core.Response;
-import java.io.IOException;
-import java.util.UUID;
-
-import static org.hamcrest.CoreMatchers.containsString;
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.Matchers.not;
-import static org.junit.Assert.assertThat;
-
 public class EdgeNotValidAnymoreTest extends AAISetup {
 
     private HttpTestUtil testUtil;
@@ -53,7 +55,8 @@ public class EdgeNotValidAnymoreTest extends AAISetup {
     @Before
     public void setupData() throws IOException, AAIException {
 
-        String cloudRegionEndpoint = "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/junit-cloud-owner-with-vlan/junit-cloud-region-with-vlan";
+        String cloudRegionEndpoint =
+                "/aai/v13/cloud-infrastructure/cloud-regions/cloud-region/junit-cloud-owner-with-vlan/junit-cloud-region-with-vlan";
 
         String cloudRegionBody = PayloadUtil.getResourcePayload("cloud-region-with-vlan.json");
         testUtil = new HttpTestUtil(QueryStyle.TRAVERSAL_URI);
@@ -62,18 +65,13 @@ public class EdgeNotValidAnymoreTest extends AAISetup {
         JanusGraphTransaction transaction = AAIGraph.getInstance().getGraph().newTransaction();
         GraphTraversalSource g = transaction.traversal();
 
-        Vertex configurationVertex = g.addV()
-            .property( AAIProperties.NODE_TYPE, "configuration")
-            .property( "configuration-id", "ci1")
-            .property( "configuration-type", "ci1")
-            .property( AAIProperties.AAI_URI, "/network/configurations/configuration/ci1")
-            .property(AAIProperties.SOURCE_OF_TRUTH, "JUNIT")
-            .next();
+        Vertex configurationVertex = g.addV().property(AAIProperties.NODE_TYPE, "configuration")
+                .property("configuration-id", "ci1").property("configuration-type", "ci1")
+                .property(AAIProperties.AAI_URI, "/network/configurations/configuration/ci1")
+                .property(AAIProperties.SOURCE_OF_TRUTH, "JUNIT").next();
 
-        Vertex vlanVertex = g.V()
-            .has("vlan-interface", "test-vlan-interface-1")
-            .has(AAIProperties.NODE_TYPE, "vlan")
-            .next();
+        Vertex vlanVertex =
+                g.V().has("vlan-interface", "test-vlan-interface-1").has(AAIProperties.NODE_TYPE, "vlan").next();
 
         Edge edge = configurationVertex.addEdge("org.onap.relationships.inventory.PartOf", vlanVertex);
         addEdge(edge);
@@ -104,16 +102,13 @@ public class EdgeNotValidAnymoreTest extends AAISetup {
     }
 
     @After
-    public void teardown(){
+    public void teardown() {
 
         JanusGraph janusGraph = AAIGraph.getInstance().getGraph();
         JanusGraphTransaction transaction = janusGraph.newTransaction();
         GraphTraversalSource g = transaction.traversal();
 
-        g.V()
-            .has(AAIProperties.SOURCE_OF_TRUTH, "JUNIT")
-            .toList()
-            .forEach((edge) -> edge.remove());
+        g.V().has(AAIProperties.SOURCE_OF_TRUTH, "JUNIT").toList().forEach((edge) -> edge.remove());
 
         transaction.commit();
     }