aboutsummaryrefslogtreecommitdiffstats
path: root/rest-services/dmaap-client/src/test
diff options
context:
space:
mode:
authorMarcin Migdal <marcin.migdal@nokia.com>2019-03-19 13:14:24 +0100
committerMarcin Migdal <marcin.migdal@nokia.com>2019-03-19 13:14:24 +0100
commit7abe2954d3783cb8a6484f012507be95d59c82b9 (patch)
tree2c7f414a9d1ed4c38f868807e5378c99c27c3458 /rest-services/dmaap-client/src/test
parentc852448b1e6ca5e28e0b0dab26c2af3d5af3f390 (diff)
Change CloudHttpClient API parse Array
Change-Id: I1127ab28ee4f0e482540829f26acfc1bc8f5667c Issue-ID: DCAEGEN2-1310 Signed-off-by: mmigdal <marcin.migdal@nokia.com> Signed-off-by: Marcin Migdal <marcin.migdal@nokia.com>
Diffstat (limited to 'rest-services/dmaap-client/src/test')
-rw-r--r--rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClientTest.java9
-rw-r--r--rest-services/dmaap-client/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker1
2 files changed, 6 insertions, 4 deletions
diff --git a/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClientTest.java b/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClientTest.java
index d2ca5d12..c37514eb 100644
--- a/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClientTest.java
+++ b/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPConsumerReactiveHttpClientTest.java
@@ -23,6 +23,7 @@ package org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.service.consum
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
+import com.google.gson.JsonArray;
import java.net.URI;
import java.util.Optional;
import org.apache.http.entity.ContentType;
@@ -44,7 +45,7 @@ class DMaaPConsumerReactiveHttpClientTest {
private static final String JSON_MESSAGE = "{ \"responseFromDmaap\": \"Success\"}";
private DMaaPConsumerReactiveHttpClient dmaapConsumerReactiveHttpClient;
private DmaapConsumerConfiguration consumerConfigurationMock = mock(DmaapConsumerConfiguration.class);
- private Mono<String> expectedResult;
+ private Mono<JsonArray> expectedResult;
private CloudHttpClient httpClient = mock(CloudHttpClient.class);
private URI exampleTestUri = URI
.create("https://54.45.33.2:1234/unauthenticated.SEC_OTHER_OUTPUT/OpenDCAE-c12/c12");
@@ -67,11 +68,11 @@ class DMaaPConsumerReactiveHttpClientTest {
@Test
void getHttpResponse_Success() {
//given
- expectedResult = Mono.just(JSON_MESSAGE);
- when(httpClient.get(exampleTestUri.toString(), requestDiagnosticContext, DMaaPClientServiceUtils.getHeaders(ContentType.APPLICATION_JSON.getMimeType()), String.class))
+ expectedResult = Mono.just(mock(JsonArray.class));
+ when(httpClient.get(exampleTestUri.toString(), requestDiagnosticContext, DMaaPClientServiceUtils.getHeaders(ContentType.APPLICATION_JSON.getMimeType()), JsonArray.class))
.thenReturn(expectedResult);
//when
- Mono<String> response = dmaapConsumerReactiveHttpClient
+ Mono<JsonArray> response = dmaapConsumerReactiveHttpClient
.getDMaaPConsumerResponse(Optional.of(requestDiagnosticContext));
//then
StepVerifier.create(response).expectSubscription()
diff --git a/rest-services/dmaap-client/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/rest-services/dmaap-client/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
new file mode 100644
index 00000000..ca6ee9ce
--- /dev/null
+++ b/rest-services/dmaap-client/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker
@@ -0,0 +1 @@
+mock-maker-inline \ No newline at end of file