diff options
author | 2018-07-12 10:16:00 +0200 | |
---|---|---|
committer | 2018-08-07 10:27:50 +0200 | |
commit | 2cd0124def5b2267028e71220201efebf46fdcd4 (patch) | |
tree | fc5242000c1775d5656781f0c02dbf071ccf0b08 /prh-app-server/src | |
parent | feeef5bf392e1639a13866a727933f960c70905c (diff) |
Adding AAI reactive webClient
Change-Id: Iedf88dfe12f41f0d994bcfc7c94e21ddf945a001
Issue-ID: DCAEGEN2-609
Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src')
5 files changed, 13 insertions, 12 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java index e10c51d0..c1000fe9 100644 --- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java +++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/configuration/AppConfig.java @@ -101,7 +101,7 @@ public class AppConfig extends PrhAppConfig { public String aaiHost; @Value("${aai.aaiClientConfiguration.aaiHostPortNumber:}") - public Integer aaiHostPortNumber; + public Integer aaiPort; @Value("${aai.aaiClientConfiguration.aaiProtocol:}") public String aaiProtocol; @@ -161,9 +161,9 @@ public class AppConfig extends PrhAppConfig { public AaiClientConfiguration getAaiClientConfiguration() { return new ImmutableAaiClientConfiguration.Builder() .aaiHost(Optional.ofNullable(aaiHost).filter(isEmpty.negate()).orElse(aaiClientConfiguration.aaiHost())) - .aaiHostPortNumber( - Optional.ofNullable(aaiHostPortNumber).filter(p -> !p.toString().isEmpty()) - .orElse(aaiClientConfiguration.aaiHostPortNumber())) + .aaiPort( + Optional.ofNullable(aaiPort).filter(p -> !p.toString().isEmpty()) + .orElse(aaiClientConfiguration.aaiPort())) .aaiIgnoreSslCertificateErrors( Optional.ofNullable(aaiIgnoreSslCertificateErrors).filter(p -> !p.toString().isEmpty()) .orElse(aaiClientConfiguration.aaiIgnoreSslCertificateErrors())) diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java index 71c996bd..6d1c4b9b 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/configuration/PrhAppConfigTest.java @@ -50,10 +50,10 @@ class PrhAppConfigTest { private static final String PRH_ENDPOINTS = "prh_endpoints.json"; private static final String jsonString = "{\"configs\":{\"aai\":{\"aaiClientConfiguration\":{\"aaiHost\":" - + "\"localhost\",\"aaiHostPortNumber\":8080,\"aaiIgnoreSslCertificateErrors\":true,\"aaiProtocol\":" + + "\"localhost\",\"aaiPort\":8080,\"aaiIgnoreSslCertificateErrors\":true,\"aaiProtocol\":" + "\"https\",\"aaiUserName\":\"admin\",\"aaiUserPassword\":\"admin\",\"aaiBasePath\":\"/aai/v11\"," + "\"aaiPnfPath\":\"/network/pnfs/pnf\",\"aaiHeaders\":{\"X-FromAppId\":\"prh\",\"X-TransactionId\":\"9999\"," - + "\"Accept\":\"application/json\",\"Real-Time\":\"true\",\"Authorization\":\"Basic QUFJOkFBSQ==\"}}}," + + "\"Accept\":\"application/json\",\"Real-Time\":\"true\",\"Content-Type\":\"application/merge-patch+json\",\"Authorization\":\"Basic QUFJOkFBSQ==\"}}}," + "\"dmaap\":{\"dmaapConsumerConfiguration\":{\"consumerGroup\":\"other\",\"consumerId\":\"1\"," + "\"dmaapContentType\":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2222," + "\"dmaapProtocol\":\"http\",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\"" @@ -62,10 +62,10 @@ class PrhAppConfigTest { + "\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\"}}}}"; private static final String incorrectJsonString = "{\"configs\":{\"aai\":{\"aaiClientConfiguration\":{\"aaiHost\":" - + "\"localhost\",\"aaiHostPortNumber\":8080,\"aaiIgnoreSslCertificateErrors\":true,\"aaiProtocol\":\"https\"," + + "\"localhost\",\"aaiPort\":8080,\"aaiIgnoreSslCertificateErrors\":true,\"aaiProtocol\":\"https\"," + "\"aaiUserName\":\"admin\",\"aaiUserPassword\":\"admin\",\"aaiBasePath\":\"/aai/v11\",\"aaiPnfPath\":" + "\"/network/pnfs/pnf\",\"aaiHeaders\":{\"X-FromAppId\":\"prh\",\"X-TransactionId\":\"9999\",\"Accept\":" - + "\"application/json\",\"Real-Time\":\"true\",\"Authorization\":\"Basic QUFJOkFBSQ==\"}}},\"dmaap\"" + + "\"application/json\",\"Real-Time\":\"true\",\"Content-Type\":\"application/merge-patch+json\",\"Authorization\":\"Basic QUFJOkFBSQ==\"}}},\"dmaap\"" + ":{\"dmaapConsumerConfiguration\":{\"consumerGroup\":\"other\",\"consumerId\":\"1\",\"dmaapContentType\"" + ":\"application/json\",\"dmaapHostName\":\"localhost\",\"dmaapPortNumber\":2222,\"dmaapProtocol\":\"http\"" + ",\"dmaapTopicName\":\"temp\",\"dmaapUserName\":\"admin\",\"dmaapUserPassword\":\"admin\",\"messageLimit\"" diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiConsumerTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiConsumerTaskImplTest.java index 8af562b2..ea458a0f 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiConsumerTaskImplTest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiConsumerTaskImplTest.java @@ -67,7 +67,7 @@ class AaiConsumerTaskImplTest { static void setUp() { aaiClientConfiguration = new ImmutableAaiClientConfiguration.Builder() .aaiHost(AAI_HOST) - .aaiHostPortNumber(PORT) + .aaiPort(PORT) .aaiProtocol(PROTOCOL) .aaiUserName(USER_NAME_PASSWORD) .aaiUserPassword(USER_NAME_PASSWORD) diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java index 5e60bf0f..90206122 100644 --- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java +++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiProducerTaskImplTest.java @@ -71,7 +71,7 @@ class AaiProducerTaskImplTest { static void setUp() { aaiClientConfiguration = new ImmutableAaiClientConfiguration.Builder() .aaiHost(AAI_HOST) - .aaiHostPortNumber(PORT) + .aaiPort(PORT) .aaiProtocol(PROTOCOL) .aaiUserName(USER_NAME_PASSWORD) .aaiUserPassword(USER_NAME_PASSWORD) diff --git a/prh-app-server/src/test/resources/prh_endpoints.json b/prh-app-server/src/test/resources/prh_endpoints.json index b45ce485..84ad4fc8 100644 --- a/prh-app-server/src/test/resources/prh_endpoints.json +++ b/prh-app-server/src/test/resources/prh_endpoints.json @@ -3,7 +3,7 @@ "aai": { "aaiClientConfiguration": { "aaiHost": "localhost", - "aaiHostPortNumber": 8080, + "aaiPort": 8080, "aaiIgnoreSSLCertificateErrors": true, "aaiProtocol": "https", "aaiUserName": "AAI", @@ -14,7 +14,8 @@ "X-FromAppId": "prh", "X-TransactionId": "9999", "Accept": "application/json", - "Real-Time": "true" + "Real-Time": "true", + "Content-Type":"application/merge-patch+json" } } }, |