Reduce the number of raw-type related warnings in aai-common
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / serialization / queryformats / ResourceFormatTest.java
index 1a301b3..e26c56e 100644 (file)
@@ -20,7 +20,9 @@
 
 package org.onap.aai.serialization.queryformats;
 
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
 
@@ -31,7 +33,6 @@ import java.util.Arrays;
 import javax.ws.rs.core.MultivaluedHashMap;
 import javax.ws.rs.core.MultivaluedMap;
 
-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.apache.tinkerpop.gremlin.structure.T;
@@ -42,7 +43,6 @@ import org.junit.Test;
 import org.mockito.Mock;
 import org.mockito.MockitoAnnotations;
 import org.onap.aai.AAISetup;
-import org.onap.aai.dbmap.DBConnectionType;
 import org.onap.aai.exceptions.AAIException;
 import org.onap.aai.introspection.Loader;
 import org.onap.aai.introspection.ModelType;
@@ -130,8 +130,9 @@ public class ResourceFormatTest extends AAISetup {
         createLoaderEngineSetup();
         serializer = new DBSerializer(schemaVersions.getAppRootVersion(), dbEngine, factoryType, "Junit");
 
-        FormatFactory ff = new FormatFactory(loader, serializer, schemaVersions, basePath);
-        MultivaluedMap mvm = new MultivaluedHashMap();
+        FormatFactory ff =
+                new FormatFactory(loader, serializer, schemaVersions, basePath, "https://localhost:8447/aai/");
+        MultivaluedMap<String, String> mvm = new MultivaluedHashMap<>();
         mvm.add("depth", "0");
         Formatter formatter = ff.get(Format.resource, mvm);
 
@@ -144,7 +145,7 @@ public class ResourceFormatTest extends AAISetup {
 
         if (loader == null) {
             loader = loaderFactory.createLoaderForVersion(factoryType, schemaVersions.getAppRootVersion());
-            dbEngine = spy(new JanusGraphDBEngine(QueryStyle.TRAVERSAL, DBConnectionType.CACHED, loader));
+            dbEngine = spy(new JanusGraphDBEngine(QueryStyle.TRAVERSAL, loader));
 
             TransactionalGraphEngine.Admin spyAdmin = spy(dbEngine.asAdmin());
 
@@ -152,7 +153,7 @@ public class ResourceFormatTest extends AAISetup {
             when(dbEngine.asAdmin()).thenReturn(spyAdmin);
 
             when(spyAdmin.getReadOnlyTraversalSource())
-                    .thenReturn(graph.traversal(GraphTraversalSource.build().with(ReadOnlyStrategy.instance())));
+                    .thenReturn(graph.traversal().withStrategies(ReadOnlyStrategy.instance()));
             when(spyAdmin.getTraversalSource()).thenReturn(graph.traversal());
         }
     }