aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test/java/org
diff options
context:
space:
mode:
authorpkaras <piotr.karas@nokia.com>2018-11-05 16:04:54 +0100
committerpkaras <piotr.karas@nokia.com>2018-11-05 16:10:17 +0100
commite8a80102a45458b3f1d15e07dc0a63e1370c44a7 (patch)
tree374b4fc2d3b7577da8612ab92998f0e25090f147 /prh-app-server/src/test/java/org
parent600c05b1530c120b34370e86e92dfd79421474fe (diff)
DmaaP Publisher and consumer interfaces ssl setup
Change-Id: I971d0fb222c6e8e15de4fc4a4d9eeb4ef3a99f44 Issue-ID: DCAEGEN2-944 Signed-off-by: piotr.karas <piotr.karas@nokia.com>
Diffstat (limited to 'prh-app-server/src/test/java/org')
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java9
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java6
2 files changed, 8 insertions, 7 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java
index fe9f6f78..1a858917 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskImplTest.java
@@ -36,8 +36,8 @@ import org.onap.dcaegen2.services.prh.config.DmaapConsumerConfiguration;
import org.onap.dcaegen2.services.prh.configuration.AppConfig;
import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel;
-import org.onap.dcaegen2.services.prh.service.DMaaPReactiveWebClient;
import org.onap.dcaegen2.services.prh.service.DmaapConsumerJsonParser;
+import org.onap.dcaegen2.services.prh.service.consumer.ConsumerReactiveHttpClientFactory;
import org.onap.dcaegen2.services.prh.service.consumer.DMaaPConsumerReactiveHttpClient;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -120,9 +120,8 @@ class DmaapConsumerTaskImplTest {
dMaaPConsumerReactiveHttpClient = mock(DMaaPConsumerReactiveHttpClient.class);
when(dMaaPConsumerReactiveHttpClient.getDMaaPConsumerResponse()).thenReturn(Mono.just(message.orElse("")));
when(appConfig.getDmaapConsumerConfiguration()).thenReturn(dmaapConsumerConfiguration);
- DMaaPReactiveWebClient dmaapReactiveWebClient = mock(DMaaPReactiveWebClient.class);
- dmaapConsumerTask =
- spy(new DmaapConsumerTaskImpl(appConfig, new DmaapConsumerJsonParser(), dmaapReactiveWebClient));
- doReturn(dMaaPConsumerReactiveHttpClient).when(dmaapConsumerTask).resolveClient();
+ ConsumerReactiveHttpClientFactory httpClientFactory = mock(ConsumerReactiveHttpClientFactory.class);
+ doReturn(dMaaPConsumerReactiveHttpClient).when(httpClientFactory).create(dmaapConsumerConfiguration);
+ dmaapConsumerTask = new DmaapConsumerTaskImpl(appConfig, new DmaapConsumerJsonParser(), httpClientFactory);
}
} \ No newline at end of file
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
index e9eed698..5bdcba52 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
@@ -41,6 +41,7 @@ import org.onap.dcaegen2.services.prh.exceptions.PrhTaskException;
import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.ImmutableConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.service.producer.DMaaPPublisherReactiveHttpClient;
+import org.onap.dcaegen2.services.prh.service.producer.PublisherReactiveHttpClientFactory;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import reactor.core.publisher.Mono;
@@ -119,8 +120,9 @@ class DmaapPublisherTaskImplTest {
dMaaPPublisherReactiveHttpClient = mock(DMaaPPublisherReactiveHttpClient.class);
when(dMaaPPublisherReactiveHttpClient.getDMaaPProducerResponse(any()))
.thenReturn(Mono.just(responseEntity));
- dmaapPublisherTask = spy(new DmaapPublisherTaskImpl(appConfig));
- doReturn(dMaaPPublisherReactiveHttpClient).when(dmaapPublisherTask).resolveClient();
+ PublisherReactiveHttpClientFactory httpClientFactory = mock(PublisherReactiveHttpClientFactory.class);
+ doReturn(dMaaPPublisherReactiveHttpClient).when(httpClientFactory).create(dmaapPublisherConfiguration);
+ dmaapPublisherTask = new DmaapPublisherTaskImpl(appConfig, httpClientFactory);
return responseEntity;
}
} \ No newline at end of file