package org.onap.aai.serialization.queryformats;
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
import com.google.gson.JsonObject;
+
+import java.util.*;
+
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.annotation.DirtiesContext;
-import java.util.*;
-
-import static org.junit.Assert.*;
-import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
-
@DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
public class RawFormatTest extends AAISetup {
}
@Test
- public void verifyPserverRelatedToHasEdgeLabel()
- throws AAIFormatVertexException {
- assertEquals("org.onap.relationships.inventory.LocatedIn", rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("relationship-label").getAsString());
+ public void verifyPserverRelatedToHasEdgeLabel() throws AAIFormatVertexException {
+ assertEquals("org.onap.relationships.inventory.LocatedIn", rawFormat.createRelationshipObject(pserver).get(0)
+ .getAsJsonObject().get("relationship-label").getAsString());
}
@Test
- public void verifyPserverRelatedToComplexLabel()
- throws AAIFormatVertexException {
- assertEquals("complex", rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("node-type").getAsString());
+ public void verifyPserverRelatedToComplexLabel() throws AAIFormatVertexException {
+ assertEquals("complex",
+ rawFormat.createRelationshipObject(pserver).get(0).getAsJsonObject().get("node-type").getAsString());
}
@Test
- public void verifyComplexRelatedToHasEdgeLabel()
- throws AAIFormatVertexException {
- assertEquals("org.onap.relationships.inventory.LocatedIn", rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("relationship-label").getAsString());
+ public void verifyComplexRelatedToHasEdgeLabel() throws AAIFormatVertexException {
+ assertEquals("org.onap.relationships.inventory.LocatedIn", rawFormat.createRelationshipObject(complex).get(0)
+ .getAsJsonObject().get("relationship-label").getAsString());
}
@Test
- public void verifyComplexRelatedToPserverLabel()
- throws AAIFormatVertexException {
- assertEquals("pserver", rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("node-type").getAsString());
+ public void verifyComplexRelatedToPserverLabel() throws AAIFormatVertexException {
+ assertEquals("pserver",
+ rawFormat.createRelationshipObject(complex).get(0).getAsJsonObject().get("node-type").getAsString());
}
private void createLoaderEngineSetup() throws AAIException {
json.entrySet().forEach((System.out::println));
assertTrue(json.has("hostname"));
Map<String, List<String>> propMap = new HashMap<>();
- List<String> selectedProps = new ArrayList<String>( Arrays.asList("'physical-location-id'"));
- propMap.put("complex",selectedProps);
+ List<String> selectedProps = new ArrayList<String>(Arrays.asList("'physical-location-id'"));
+ propMap.put("complex", selectedProps);
JsonObject json1 = rawFormat.createSelectedPropertiesObject(complex, propMap).get();
json1.entrySet().forEach((System.out::println));
assertFalse(json1.has("aai-node-type"));
assertTrue(json1.has("physical-location-id"));
}
-
}