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/aai/PombaRestInterfaceTest.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/aai/PombaRestInterfaceTest.java')
-rw-r--r-- | vid-app-common/src/test/java/org/onap/vid/aai/PombaRestInterfaceTest.java | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/vid-app-common/src/test/java/org/onap/vid/aai/PombaRestInterfaceTest.java b/vid-app-common/src/test/java/org/onap/vid/aai/PombaRestInterfaceTest.java index b409c1f46..5de993c73 100644 --- a/vid-app-common/src/test/java/org/onap/vid/aai/PombaRestInterfaceTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/aai/PombaRestInterfaceTest.java @@ -20,30 +20,9 @@ package org.onap.vid.aai; -import org.mockito.Mock; -import org.onap.vid.aai.util.HttpClientMode; -import org.onap.vid.aai.util.HttpsAuthClient; -import org.onap.vid.aai.util.ServletRequestHelper; -import org.onap.vid.aai.util.SystemPropertyHelper; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.Test; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - -import java.io.IOException; -import java.security.GeneralSecurityException; -import java.util.UUID; -import java.util.regex.Pattern; - import static org.assertj.core.api.Assertions.assertThat; - -import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; import static org.mockito.ArgumentMatchers.matches; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.verify; @@ -53,6 +32,25 @@ import static org.onap.vid.aai.AaiOverTLSClientInterface.HEADERS.FROM_APP_ID_HEA import static org.onap.vid.aai.AaiOverTLSClientInterface.HEADERS.TRANSACTION_ID_HEADER; import static org.onap.vid.utils.Logging.REQUEST_ID_HEADER_KEY; +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.util.UUID; +import java.util.regex.Pattern; +import javax.ws.rs.client.Client; +import javax.ws.rs.client.Entity; +import javax.ws.rs.client.Invocation; +import javax.ws.rs.client.WebTarget; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; +import org.mockito.Mock; +import org.onap.vid.aai.util.HttpClientMode; +import org.onap.vid.aai.util.HttpsAuthClient; +import org.onap.vid.aai.util.ServletRequestHelper; +import org.onap.vid.aai.util.SystemPropertyHelper; +import org.onap.vid.utils.Logging; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + public class PombaRestInterfaceTest { private static final String UUID_REGEX = "[a-f0-9]{8}(-[a-f0-9]{4}){3}-[a-f0-9]{12}"; private static final String SAMPLE_APP_ID = "vid"; @@ -81,6 +79,9 @@ public class PombaRestInterfaceTest { @Mock private Response response; + @Mock + private Logging loggingService; + private PombaRestInterface pombaRestInterface; @BeforeMethod @@ -90,7 +91,7 @@ public class PombaRestInterfaceTest { when(requestHelper.extractOrGenerateRequestId()).thenReturn(UUID.randomUUID().toString()); when(authClient.getClient(HttpClientMode.WITH_KEYSTORE)).thenReturn(client); setUpBuilder(); - pombaRestInterface = new PombaRestInterface(authClient, requestHelper, systemPropertyHelper); + pombaRestInterface = new PombaRestInterface(authClient, requestHelper, systemPropertyHelper, loggingService); } @@ -124,4 +125,4 @@ public class PombaRestInterfaceTest { when(builder.post(any(Entity.class))).thenReturn(response); when(response.getStatusInfo()).thenReturn(Response.Status.OK); } -}
\ No newline at end of file +} |