aboutsummaryrefslogtreecommitdiffstats
path: root/prh-aai-client/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'prh-aai-client/src/test')
-rw-r--r--prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java23
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");
- }
-
}