diff options
author | Ittay Stern <ittay.stern@att.com> | 2019-09-12 07:47:32 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2019-09-12 07:47:32 +0000 |
commit | ca6f40516028602d3551856301cd9d7cda65f812 (patch) | |
tree | c114fcde5bd53e1b1aaaaa8625eaa553a7b043fa /vid-app-common/src/test/java/org/onap/vid/aai/PombaRestInterfaceTest.java | |
parent | 4996ccfb67d22533da5d5021284e41b6612e4aec (diff) | |
parent | 2265215c803291e029add2db7912c7b1e25e0a8e (diff) |
Merge "make Logging a service and inject it to SyncRestClient"
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 +} |