From cef5a0b50f07e4e658ff9d2e058d6aa6eb8cb780 Mon Sep 17 00:00:00 2001 From: PatrikBuhr Date: Fri, 6 Nov 2020 12:07:28 +0100 Subject: Added support for using HTTP proxy A HTTP proxy may be used to access NearRT-RICs For other HTTP acces; Consul; DMAAP, local, and R-APP callbacks no proxy is used. Change-Id: Ibc3ed8bada76cafb23323bf03b28a9876bed60eb Issue-ID: CCSDK-2502 Signed-off-by: PatrikBuhr --- .../oran/a1policymanagementservice/clients/AsyncRestClientTest.java | 2 +- .../a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java | 2 +- .../oran/a1policymanagementservice/controllers/v1/ApplicationTest.java | 3 ++- .../oran/a1policymanagementservice/controllers/v2/ApplicationTest.java | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) (limited to 'a1-policy-management/src/test/java') diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java index 36bbda57..2e583f65 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java @@ -58,7 +58,7 @@ class AsyncRestClientTest { InternalLoggerFactory.setDefaultFactory(JdkLoggerFactory.INSTANCE); Loggers.useJdkLoggers(); mockWebServer = new MockWebServer(); - clientUnderTest = new AsyncRestClient(mockWebServer.url(BASE_URL).toString()); + clientUnderTest = new AsyncRestClient(mockWebServer.url(BASE_URL).toString(), null, null); } @AfterAll diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java index aad1ed02..985ce558 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/CcsdkA1AdapterClientTest.java @@ -85,7 +85,7 @@ class CcsdkA1AdapterClientTest { @Test void createClientWithWrongProtocol_thenErrorIsThrown() { assertThrows(IllegalArgumentException.class, () -> { - new CcsdkA1AdapterClient(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null)); + new CcsdkA1AdapterClient(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null, null)); }); } diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java index 551ed599..b5164889 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v1/ApplicationTest.java @@ -720,10 +720,11 @@ class ApplicationTest { .isTrustStoreUsed(useTrustValidation) // .trustStore(config.trustStore()) // .trustStorePassword(config.trustStorePassword()) // + .httpProxyConfig(config.httpProxyConfig()) // .build(); AsyncRestClientFactory f = new AsyncRestClientFactory(config); - return f.createRestClient(baseUrl()); + return f.createRestClientNoHttpProxy(baseUrl()); } private AsyncRestClient restClient() { diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java index a0cb2af8..5e089a0b 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ApplicationTest.java @@ -790,10 +790,11 @@ class ApplicationTest { .isTrustStoreUsed(useTrustValidation) // .trustStore(config.trustStore()) // .trustStorePassword(config.trustStorePassword()) // + .httpProxyConfig(config.httpProxyConfig()) // .build(); AsyncRestClientFactory f = new AsyncRestClientFactory(config); - return f.createRestClient(baseUrl); + return f.createRestClientNoHttpProxy(baseUrl); } -- cgit 1.2.3-korg