diff options
author | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-10 16:31:01 +0300 |
---|---|---|
committer | Eylon Malin <eylon.malin@intl.att.com> | 2019-09-12 08:51:25 +0300 |
commit | 2265215c803291e029add2db7912c7b1e25e0a8e (patch) | |
tree | 3082c232fa26483a0f1262efcc5c228d554280d1 /vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java | |
parent | 77e77f77c89ca1bef622b12c71897ab1ab256216 (diff) |
make Logging a service and inject it to SyncRestClient
Issue-ID: VID-611
Change-Id: I120782884351c55b2e0d1b4ca8bae1e2479d1d0a
Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java b/vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java index 18b4089b5..b30cf5f32 100644 --- a/vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/client/SyncRestClientForHttpServerTest.java @@ -20,31 +20,32 @@ 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 |