Reduce the number of raw-type related warnings in aai-common
[aai/aai-common.git] / aai-schema-ingest / src / test / java / org / onap / aai / restclient / MockRestClient.java
index 4025a20..9715f0e 100644 (file)
 package org.onap.aai.restclient;
 
 import static org.junit.Assert.assertNotNull;
-import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.content;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.method;
+import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
 import static org.springframework.test.web.client.response.MockRestResponseCreators.withStatus;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
@@ -40,7 +40,12 @@ import java.util.Map;
 
 import org.apache.commons.io.IOUtils;
 import org.springframework.core.io.Resource;
-import org.springframework.http.*;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.stereotype.Component;
 import org.springframework.test.web.client.ExpectedCount;
 import org.springframework.test.web.client.MockRestServiceServer;
@@ -186,7 +191,7 @@ public class MockRestClient extends RestClient {
     }
 
     @Override
-    public ResponseEntity execute(String uri, HttpMethod method, Map<String, String> headers, String body) {
+    public ResponseEntity<String> execute(String uri, HttpMethod method, Map<String, String> headers, String body) {
 
         String url = "https://localhost:8447/aai/v14/" + uri;
 
@@ -222,16 +227,17 @@ public class MockRestClient extends RestClient {
         headersMap.add("X-FromAppId", "JUNIT");
         headersMap.add("X-TransactionId", "JUNIT");
 
-        HttpEntity httpEntity = new HttpEntity(headers);
+        HttpEntity<String> httpEntity = new HttpEntity(headers);
 
-        ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class);
+        ResponseEntity<String> responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, String.class);
 
         // mockRestServiceServer.verify();
         return responseEntity;
     }
 
     @Override
-    public ResponseEntity executeResource(String uri, HttpMethod method, Map<String, String> headers, String body) {
+    public ResponseEntity<Resource> executeResource(String uri, HttpMethod method, Map<String, String> headers,
+            String body) {
 
         String url = "https://localhost:8447/aai/v14/" + uri;
 
@@ -267,9 +273,10 @@ public class MockRestClient extends RestClient {
         headersMap.add("X-FromAppId", "JUNIT");
         headersMap.add("X-TransactionId", "JUNIT");
 
-        HttpEntity httpEntity = new HttpEntity(headers);
+        HttpEntity<String> httpEntity = new HttpEntity(headers);
 
-        ResponseEntity responseEntity = restTemplate.exchange(url, HttpMethod.GET, httpEntity, Resource.class);
+        ResponseEntity<Resource> responseEntity =
+                restTemplate.exchange(url, HttpMethod.GET, httpEntity, Resource.class);
 
         // mockRestServiceServer.verify();
         return responseEntity;