diff options
author | 2018-11-06 12:22:28 +0100 | |
---|---|---|
committer | 2018-11-06 13:14:46 +0100 | |
commit | 8a762124d24555d50ce7455398ca3ac02fde1076 (patch) | |
tree | d31fc5feb13438a364e74fc8b4f2d4e9f39f4be7 /prh-app-server/src/test | |
parent | 8330d0e6c2cf1d9d8215e13b928530c2277fa974 (diff) |
SSL setup for dmaap consumer
Change-Id: I5856554fa05cfd9ad637c0491eb801f9937c967a
Issue-ID: DCAEGEN2-951
Signed-off-by: piotr.karas <piotr.karas@nokia.com>
Diffstat (limited to 'prh-app-server/src/test')
2 files changed, 6 insertions, 4 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 1a858917..35da3323 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 @@ -82,7 +82,7 @@ class DmaapConsumerTaskImplTest { } @Test - void whenPassedObjectDoesntFit_DoesNotThrowPrhTaskException() { + void whenPassedObjectDoesntFit_DoesNotThrowPrhTaskException() throws Exception { //given prepareMocksForDmaapConsumer(Optional.empty()); @@ -95,7 +95,7 @@ class DmaapConsumerTaskImplTest { } @Test - void whenPassedObjectFits_ReturnsCorrectResponse() { + void whenPassedObjectFits_ReturnsCorrectResponse() throws Exception { //given prepareMocksForDmaapConsumer(Optional.of(message)); @@ -116,7 +116,7 @@ class DmaapConsumerTaskImplTest { verify(appConfig).initFileStreamReader(); } - private void prepareMocksForDmaapConsumer(Optional<String> message) { + private void prepareMocksForDmaapConsumer(Optional<String> message) throws Exception { dMaaPConsumerReactiveHttpClient = mock(DMaaPConsumerReactiveHttpClient.class); when(dMaaPConsumerReactiveHttpClient.getDMaaPConsumerResponse()).thenReturn(Mono.just(message.orElse(""))); when(appConfig.getDmaapConsumerConfiguration()).thenReturn(dmaapConsumerConfiguration); diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskSpy.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskSpy.java index f42c3962..d2eabfc9 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskSpy.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapConsumerTaskSpy.java @@ -24,6 +24,7 @@ import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; +import javax.net.ssl.SSLException; import org.onap.dcaegen2.services.prh.config.DmaapConsumerConfiguration; import org.onap.dcaegen2.services.prh.configuration.AppConfig; import org.onap.dcaegen2.services.prh.service.consumer.DMaaPConsumerReactiveHttpClient; @@ -31,6 +32,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; + /** * @author <a href="mailto:przemyslaw.wasala@nokia.com">Przemysław Wąsala</a> on 3/27/18 */ @@ -44,7 +46,7 @@ public class DmaapConsumerTaskSpy { */ @Bean @Primary - public DmaapConsumerTask registerSimpleDmaapConsumerTask() { + public DmaapConsumerTask registerSimpleDmaapConsumerTask() throws SSLException { AppConfig appConfig = spy(AppConfig.class); doReturn(mock(DmaapConsumerConfiguration.class)).when(appConfig).getDmaapConsumerConfiguration(); DmaapConsumerTaskImpl dmaapConsumerTask = spy(new DmaapConsumerTaskImpl(appConfig)); |