diff options
author | micdzied <michal.1.dziedzic@nokia.com> | 2018-08-30 10:25:19 +0200 |
---|---|---|
committer | micdzied <michal.1.dziedzic@nokia.com> | 2018-08-30 14:53:20 +0200 |
commit | 6fd8c7770fbea30ad2ec6e3f7645b8baab5a49a1 (patch) | |
tree | 78d572b5df8c88047d74edf3c75b28fcab3d0dc6 /prh-aai-client/src/test/java | |
parent | 82a6fc31d1905f380fbbae1d0b4a34b67d8258e3 (diff) |
add MDC's
Change-Id: Ie4fe86791f46b790ae42088a5d2b93f491e4549d
Issue-ID: DCAEGEN2-730
Signed-off-by: micdzied <michal.1.dziedzic@nokia.com>
Diffstat (limited to 'prh-aai-client/src/test/java')
-rw-r--r-- | prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java index c99deca5..9b0f4fe8 100644 --- a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java +++ b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java @@ -45,10 +45,8 @@ import reactor.test.StepVerifier; class AaiProducerReactiveHttpClientTest { - private static AaiProducerReactiveHttpClient aaiProducerReactiveHttpClient; - private static final Integer SUCCESS_RESPONSE = 200; - + private static AaiProducerReactiveHttpClient aaiProducerReactiveHttpClient; private static AaiClientConfiguration aaiConfigurationMock = mock(AaiClientConfiguration.class); private static WebClient webClient = mock(WebClient.class); @@ -82,6 +80,14 @@ class AaiProducerReactiveHttpClientTest { responseSpec = mock(ResponseSpec.class); } + private static void setupHeaders() { + aaiHeaders = new HashMap<>(); + aaiHeaders.put("X-FromAppId", "PRH"); + aaiHeaders.put("X-TransactionId", "vv-temp"); + aaiHeaders.put("Accept", "application/json"); + aaiHeaders.put("Real-Time", "true"); + aaiHeaders.put("Content-Type", "application/merge-patch+json"); + } @Test void getAaiProducerResponse_shouldReturn200() { @@ -118,24 +124,15 @@ class AaiProducerReactiveHttpClientTest { )).expectSubscription().expectError(Exception.class).verify(); } - private void mockWebClientDependantObject() { WebClient.RequestHeadersSpec requestHeadersSpec = mock(WebClient.RequestHeadersSpec.class); when(webClient.patch()).thenReturn(requestBodyUriSpec); when(requestBodyUriSpec.uri((URI) any())).thenReturn(requestBodyUriSpec); + when(requestBodyUriSpec.header(any(), any())).thenReturn(requestBodyUriSpec); when(requestBodyUriSpec.body(any())).thenReturn(requestHeadersSpec); doReturn(responseSpec).when(requestHeadersSpec).retrieve(); doReturn(responseSpec).when(responseSpec).onStatus(any(), any()); } - private static void setupHeaders() { - aaiHeaders = new HashMap<>(); - aaiHeaders.put("X-FromAppId", "PRH"); - aaiHeaders.put("X-TransactionId", "vv-temp"); - aaiHeaders.put("Accept", "application/json"); - aaiHeaders.put("Real-Time", "true"); - aaiHeaders.put("Content-Type", "application/merge-patch+json"); - } - } |