From 41fddf53b41e2870a94fa54454bd60665cc203c1 Mon Sep 17 00:00:00 2001 From: Piotr Jaszczyk Date: Wed, 9 Jan 2019 15:08:46 +0100 Subject: High Volume VES Collector Client - stub Other minor changes: * Set dependencies to compatible versions (spring, spring-boot and reactor + reactor-netty) * Fix compilation errors on Java 11 Change-Id: If482c0dffd7162315df6d7b7fdedf554ef7c5d9d Issue-ID: DCAEGEN2-1070 Signed-off-by: Piotr Jaszczyk --- rest-services/dmaap-client/pom.xml | 8 ++++---- .../service/consumer/DMaaPReactiveWebClientFactoryTest.java | 10 ++++++++-- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'rest-services/dmaap-client') diff --git a/rest-services/dmaap-client/pom.xml b/rest-services/dmaap-client/pom.xml index e34dfa17..ec916052 100644 --- a/rest-services/dmaap-client/pom.xml +++ b/rest-services/dmaap-client/pom.xml @@ -7,13 +7,13 @@ org.onap.dcaegen2.services.sdk dcaegen2-services-sdk-rest-services - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT ../pom.xml org.onap.dcaegen2.services.sdk.rest.services dmaap-client - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT dcaegen2-services-sdk-rest-services-dmaap-client DMaaP Rest Services Module @@ -23,7 +23,7 @@ org.onap.dcaegen2.services.sdk.rest.services common-dependency - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT org.springframework @@ -68,7 +68,7 @@ org.onap.dcaegen2.services.sdk.rest.services aai-client - 1.1.0-SNAPSHOT + 1.1.1-SNAPSHOT test diff --git a/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPReactiveWebClientFactoryTest.java b/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPReactiveWebClientFactoryTest.java index d28bc5d7..d9989d1d 100644 --- a/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPReactiveWebClientFactoryTest.java +++ b/rest-services/dmaap-client/src/test/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/service/consumer/DMaaPReactiveWebClientFactoryTest.java @@ -24,6 +24,8 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import io.netty.handler.ssl.SslContext; +import javax.net.ssl.SSLException; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.config.DmaapConsumerConfiguration; @@ -40,6 +42,7 @@ class DMaaPReactiveWebClientFactoryTest { private static final String TRUST_STORE = "trustStore"; private static final String TRUST_STORE_PASS = "trustStorePass"; private SslFactory sslFactory = mock(SslFactory.class); + private SslContext dummySslContext = mock(SslContext.class); private DMaaPReactiveWebClientFactory webClientFactory = new DMaaPReactiveWebClientFactory(sslFactory); @Test @@ -68,19 +71,22 @@ class DMaaPReactiveWebClientFactoryTest { verify(sslFactory).createSecureContext(KEY_STORE, KEY_STORE_PASS, TRUST_STORE, TRUST_STORE_PASS); } - private DmaapConsumerConfiguration givenDmaapConfigurationWithSslDisabled() { + private DmaapConsumerConfiguration givenDmaapConfigurationWithSslDisabled() throws SSLException { DmaapConsumerConfiguration dmaapConsumerConfiguration = mock(DmaapConsumerConfiguration.class); when(dmaapConsumerConfiguration.enableDmaapCertAuth()).thenReturn(false); + when(sslFactory.createInsecureContext()).thenReturn(dummySslContext); return dmaapConsumerConfiguration; } - private DmaapConsumerConfiguration givenDmaapConfigurationWithSslEnabled() { + private DmaapConsumerConfiguration givenDmaapConfigurationWithSslEnabled() throws SSLException { DmaapConsumerConfiguration dmaapConsumerConfiguration = mock(DmaapConsumerConfiguration.class); when(dmaapConsumerConfiguration.enableDmaapCertAuth()).thenReturn(true); when(dmaapConsumerConfiguration.keyStorePath()).thenReturn(KEY_STORE); when(dmaapConsumerConfiguration.keyStorePasswordPath()).thenReturn(KEY_STORE_PASS); when(dmaapConsumerConfiguration.trustStorePath()).thenReturn(TRUST_STORE); when(dmaapConsumerConfiguration.trustStorePasswordPath()).thenReturn(TRUST_STORE_PASS); + when(sslFactory.createSecureContext(KEY_STORE, KEY_STORE_PASS, TRUST_STORE, TRUST_STORE_PASS)) + .thenReturn(dummySslContext); return dmaapConsumerConfiguration; } } \ No newline at end of file -- cgit 1.2.3-korg