diff options
Diffstat (limited to 'prh-app-server/src/test/java/org')
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)); |