summaryrefslogtreecommitdiffstats
path: root/prh-aai-client
diff options
context:
space:
mode:
authorwasala <przemyslaw.wasala@nokia.com>2018-10-18 08:07:37 +0200
committerwasala <przemyslaw.wasala@nokia.com>2018-10-18 10:24:00 +0200
commit39300ffd1dde766624036b361e444e5ef30371ce (patch)
treec9f89b6d77aa50cf531dccc314ef0d167353a1db /prh-aai-client
parentbb31441a6f401a0c819cb8158be85bf51cdfd405 (diff)
Fixed Reactor-Netty SSL_conf3.0.1-ONAP3.0.0-ONAP1.1.1
*Error calling secure AAI http client Change-Id: Ie4ba090f9ed33e134d584270e3ae875cd54472b6 Issue-ID: DCAEGEN2-870 Signed-off-by: wasala <przemyslaw.wasala@nokia.com>
Diffstat (limited to 'prh-aai-client')
-rw-r--r--prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java8
-rw-r--r--prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java4
2 files changed, 5 insertions, 7 deletions
diff --git a/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java b/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java
index 256aa3b9..5963d9c3 100644
--- a/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java
+++ b/prh-aai-client/src/main/java/org/onap/dcaegen2/services/prh/service/AaiReactiveWebClient.java
@@ -27,20 +27,18 @@ import static org.springframework.web.reactive.function.client.ExchangeFilterFun
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;
import io.netty.handler.ssl.util.InsecureTrustManagerFactory;
-
import java.util.Map;
import javax.net.ssl.SSLException;
-
import org.onap.dcaegen2.services.prh.config.AaiClientConfiguration;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;
import org.springframework.http.client.reactive.ClientHttpConnector;
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
-import org.springframework.http.client.reactive.ReactorResourceFactory;
import org.springframework.web.reactive.function.client.ExchangeFilterFunction;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Mono;
+import reactor.netty.http.client.HttpClient;
public class AaiReactiveWebClient {
@@ -75,8 +73,8 @@ public class AaiReactiveWebClient {
.forClient()
.trustManager(InsecureTrustManagerFactory.INSTANCE)
.build();
- ClientHttpConnector reactorClientHttpConnector = new ReactorClientHttpConnector(new ReactorResourceFactory(),
- httpClient -> httpClient.secure(sslContextSpec -> sslContextSpec.sslContext(sslContext)));
+ ClientHttpConnector reactorClientHttpConnector = new ReactorClientHttpConnector(
+ HttpClient.create().secure(sslContextSpec -> sslContextSpec.sslContext(sslContext)));
return WebClient.builder()
.clientConnector(reactorClientHttpConnector)
.defaultHeaders(httpHeaders -> httpHeaders.setAll(aaiHeaders))
diff --git a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java
index 5fd966dc..d8002fb2 100644
--- a/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java
+++ b/prh-aai-client/src/test/java/org/onap/dcaegen2/services/prh/service/producer/AaiProducerReactiveHttpClientTest.java
@@ -48,11 +48,11 @@ import reactor.test.StepVerifier;
class AaiProducerReactiveHttpClientTest {
private static final Integer SUCCESS_RESPONSE = 200;
- private static AaiProducerReactiveHttpClient aaiProducerReactiveHttpClient;
private static AaiClientConfiguration aaiConfigurationMock = mock(AaiClientConfiguration.class);
- private static WebClient webClient = mock(WebClient.class);
+ private AaiProducerReactiveHttpClient aaiProducerReactiveHttpClient;
+ private WebClient webClient = mock(WebClient.class);
private ConsumerDmaapModel dmaapModel = spy(new ConsumerDmaapModelForUnitTest());
private WebClient.RequestBodyUriSpec requestBodyUriSpec;
private ResponseSpec responseSpec;