summaryrefslogtreecommitdiffstats
path: root/rest-services/dmaap-client/src
diff options
context:
space:
mode:
authorMarcin Migdal <marcin.migdal@nokia.com>2019-03-08 15:49:58 +0100
committerMarcin Migdal <marcin.migdal@nokia.com>2019-03-08 15:50:03 +0100
commita557b012ab5c51f9a5fb88328eb678eb78091118 (patch)
tree5a096caf4631f411c5052664d80616b4a825f4ed /rest-services/dmaap-client/src
parent186f69f3c3a17e0004ab6771cc5adac6a4722023 (diff)
Change CloudHttpClient API
Change-Id: Icbbe871e71c6bb46aba7411b9f9016af14c5eab9 Issue-ID: DCAEGEN2-1310 Signed-off-by: Marcin Migdal <marcin.migdal@nokia.com>
Diffstat (limited to 'rest-services/dmaap-client/src')
-rw-r--r--rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClient.java3
-rw-r--r--rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClientTest.java5
2 files changed, 5 insertions, 3 deletions
diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClient.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClient.java
index 6314bcba..84596cde 100644
--- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClient.java
+++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClient.java
@@ -33,6 +33,7 @@ import org.onap.dcaegen2.services.sdk.rest.services.model.JsonBodyBuilder;
import org.onap.dcaegen2.services.sdk.rest.services.model.logging.RequestDiagnosticContext;
import org.onap.dcaegen2.services.sdk.rest.services.uri.URI.URIBuilder;
import reactor.core.publisher.Mono;
+import reactor.netty.http.client.HttpClientResponse;
/**
@@ -64,7 +65,7 @@ public class DMaaPPublisherReactiveHttpClient extends DMaaPAbstractReactiveHttpC
* @return status code of operation
*/
- public Mono<Integer> getDMaaPProducerResponse(DmaapModel dmaapModel,
+ public Mono<HttpClientResponse> getDMaaPProducerResponse(DmaapModel dmaapModel,
Optional<RequestDiagnosticContext> requestDiagnosticContextOptional) {
return Mono.defer(() -> {
Map<String, String> headers = DMaaPClientServiceUtils.getHeaders(dmaapPublisherConfiguration.dmaapContentType());
diff --git a/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClientTest.java b/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClientTest.java
index 0ff1e207..a2b3575a 100644
--- a/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClientTest.java
+++ b/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/producer/DMaaPPublisherReactiveHttpClientTest.java
@@ -38,6 +38,7 @@ import org.onap.dcaegen2.services.sdk.rest.services.model.JsonBodyBuilder;
import org.onap.dcaegen2.services.sdk.rest.services.model.logging.RequestDiagnosticContext;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;
+import reactor.netty.http.client.HttpClientResponse;
/**
* @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 7/4/18
@@ -76,7 +77,7 @@ class DMaaPPublisherReactiveHttpClientTest {
@Test
void getHttpResponse_Success() {
//given
- Mono<Integer> expectedResult = Mono.just(Integer.valueOf(200));
+ Mono<HttpClientResponse> expectedResult = Mono.just(mock(HttpClientResponse.class));
//when
when(
cloudHttpClientMock
@@ -84,7 +85,7 @@ class DMaaPPublisherReactiveHttpClientTest {
DMaaPClientServiceUtils.getHeaders(ContentType.APPLICATION_JSON.getMimeType()),
jsonBodyBuilderMock,
mock(ClientModel.class)))
- .thenReturn(Mono.just(Integer.valueOf(200)));
+ .thenReturn(Mono.just(mock(HttpClientResponse.class)));
//then
StepVerifier.create(expectedResult).expectSubscription()
.expectNextMatches(results -> {