X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=aai-core%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Faai%2Frest%2Fdb%2FHttpEntryTest.java;h=2499defc2a99a427f247b7a48f8643bb05b220cf;hb=5eb0e49534114edf8a76fef5b2a8e50c7bdaa812;hp=1462485d3741ff624edb52a8c88b8e295203ad29;hpb=8b504f6db32630ae4b6774efabc87ed76a950053;p=aai%2Faai-common.git diff --git a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java index 1462485d..2499defc 100644 --- a/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java +++ b/aai-core/src/test/java/org/onap/aai/rest/db/HttpEntryTest.java @@ -24,7 +24,7 @@ import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; -import static org.mockito.Matchers.anyObject; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doNothing; import static org.mockito.Mockito.when; @@ -33,9 +33,21 @@ import com.google.gson.JsonParser; import java.io.UnsupportedEncodingException; import java.net.URI; -import java.util.*; - -import javax.ws.rs.core.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.UUID; + +import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.MultivaluedHashMap; +import javax.ws.rs.core.MultivaluedMap; +import javax.ws.rs.core.Response; +import javax.ws.rs.core.UriBuilder; +import javax.ws.rs.core.UriInfo; import org.javatuples.Pair; import org.json.JSONArray; @@ -127,7 +139,7 @@ public class HttpEntryTest extends AAISetup { when(uriInfo.getQueryParameters(false)).thenReturn(queryParameters); // TODO - Check if this is valid since RemoveDME2QueryParameters seems to be very unreasonable - Mockito.doReturn(null).when(queryParameters).remove(anyObject()); + Mockito.doReturn(null).when(queryParameters).remove(any()); when(httpHeaders.getMediaType()).thenReturn(APPLICATION_JSON); } @@ -276,7 +288,7 @@ public class HttpEntryTest extends AAISetup { Response response = doRequest(traversalHttpEntry, loader, dbEngine, HttpMethod.GET, uri, content); dbEngine.commit(); String msg = response.getEntity().toString(); - JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject(); + JsonObject jsonObj = JsonParser.parseString(msg).getAsJsonObject(); String resourceVersion = ""; if (jsonObj.isJsonObject()) { resourceVersion = jsonObj.get("resource-version").getAsString(); @@ -298,7 +310,7 @@ public class HttpEntryTest extends AAISetup { Response response = doRequest(traversalHttpEntry, loader, dbEngine, HttpMethod.GET, uri, content); dbEngine.commit(); String msg = response.getEntity().toString(); - JsonObject jsonObj = new JsonParser().parse(msg).getAsJsonObject(); + JsonObject jsonObj = JsonParser.parseString(msg).getAsJsonObject(); String resourceVersion = ""; if (jsonObj.isJsonObject()) { resourceVersion = jsonObj.get("resource-version").getAsString();