Replace deprecated methods in aai-common
[aai/aai-common.git] / aai-core / src / test / java / org / onap / aai / serialization / queryformats / SimpleFormatTest.java
index 886a660..7aebe84 100644 (file)
 
 package org.onap.aai.serialization.queryformats;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
+import static org.mockito.ArgumentMatchers.anyInt;
+import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
+
 import com.google.gson.JsonObject;
+
+import java.io.UnsupportedEncodingException;
+import java.util.Arrays;
+
+import javax.ws.rs.core.MultivaluedHashMap;
+import javax.ws.rs.core.MultivaluedMap;
+
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
@@ -44,15 +62,6 @@ import org.onap.aai.serialization.queryformats.exceptions.AAIFormatVertexExcepti
 import org.onap.aai.serialization.queryformats.utils.UrlBuilder;
 import org.springframework.test.annotation.DirtiesContext;
 
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.MultivaluedMap;
-import java.io.UnsupportedEncodingException;
-import java.util.Arrays;
-
-import static org.junit.Assert.*;
-import static org.mockito.Matchers.*;
-import static org.mockito.Mockito.*;
-
 @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_CLASS)
 public class SimpleFormatTest extends AAISetup {
 
@@ -131,7 +140,8 @@ public class SimpleFormatTest extends AAISetup {
         createLoaderEngineSetup();
         serializer = new DBSerializer(schemaVersions.getRelatedLinkVersion(), dbEngine, factoryType, "Junit");
 
-        FormatFactory ff = new FormatFactory(loader, serializer, schemaVersions, basePath);
+        FormatFactory ff =
+                new FormatFactory(loader, serializer, schemaVersions, basePath, "https://localhost:8447/aai/");
         MultivaluedMap mvm = new MultivaluedHashMap();
         mvm.add("depth", "0");
         Formatter formatter = ff.get(Format.simple, mvm);
@@ -150,7 +160,7 @@ public class SimpleFormatTest extends AAISetup {
 
         simpleFormat = new RawFormat.Builder(loader, serializer, urlBuilder).nodesOnly(true).depth(0).build();
 
-        when(serializer.dbToObject(anyObject(), anyObject(), anyInt(), anyBoolean(), anyString()))
+        when(serializer.dbToObject(any(), any(), anyInt(), anyBoolean(), anyString()))
                 .thenThrow(new AAIException("Test Exception"));
 
         simpleFormat.createPropertiesObject(vfModule);