make Logging a service and inject it to SyncRestClient
[vid.git] / vid-app-common / src / test / java / org / onap / vid / client / SyncRestClientForHttpServerTest.java
index 18b4089..b30cf5f 100644 (file)
 
 package org.onap.vid.client;
 
+import static com.xebialabs.restito.builder.stub.StubHttp.whenHttp;
+import static com.xebialabs.restito.builder.verify.VerifyHttp.verifyHttp;
+import static com.xebialabs.restito.semantics.Action.contentType;
+import static com.xebialabs.restito.semantics.Action.ok;
+import static com.xebialabs.restito.semantics.Action.status;
+import static com.xebialabs.restito.semantics.Action.stringContent;
+import static org.mockito.Mockito.mock;
+import static org.testng.Assert.assertEquals;
+
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.google.common.collect.ImmutableMap;
+import com.xebialabs.restito.semantics.Action;
 import com.xebialabs.restito.semantics.Condition;
 import com.xebialabs.restito.server.StubServer;
 import io.joshworks.restclient.http.HttpResponse;
 import io.joshworks.restclient.http.JsonNode;
+import java.util.Collections;
+import java.util.Map;
+import org.glassfish.grizzly.http.Method;
 import org.glassfish.grizzly.http.util.HttpStatus;
-import com.xebialabs.restito.semantics.Action;
-import org.testng.annotations.BeforeMethod;
+import org.onap.vid.utils.Logging;
 import org.testng.annotations.AfterMethod;
-import org.glassfish.grizzly.http.Method;
+import org.testng.annotations.BeforeMethod;
 import org.testng.annotations.Test;
 
-import java.util.Collections;
-import java.util.Map;
-
-import static com.xebialabs.restito.builder.verify.VerifyHttp.verifyHttp;
-import static com.xebialabs.restito.builder.stub.StubHttp.whenHttp;
-import static com.xebialabs.restito.semantics.Action.stringContent;
-import static com.xebialabs.restito.semantics.Action.contentType;
-import static com.xebialabs.restito.semantics.Action.status;
-import static com.xebialabs.restito.semantics.Action.ok;
-import static org.testng.Assert.assertEquals;
-
 public class SyncRestClientForHttpServerTest {
 
     private static final SyncRestClientModel.TestModel testObject = new SyncRestClientModel.TestModel(1, "test");
@@ -53,12 +54,14 @@ public class SyncRestClientForHttpServerTest {
     private StubServer stubServer;
     private ObjectMapper objectMapper = new ObjectMapper();
     private SyncRestClient syncRestClient;
+    private Logging mockLoggingService;
 
     @BeforeMethod
     public void setUp() {
         stubServer = new StubServer();
         stubServer.run();
-        syncRestClient = new SyncRestClient();
+        mockLoggingService = mock(Logging.class);
+        syncRestClient = new SyncRestClient(mockLoggingService);
     }
 
     @AfterMethod