diff options
author | Maciej Wejs <maciej.wejs@nokia.com> | 2018-11-06 16:38:46 +0100 |
---|---|---|
committer | Maciej Wejs <maciej.wejs@nokia.com> | 2018-11-06 16:38:46 +0100 |
commit | f4f1318b19c90016c70a0af457020361733b69f3 (patch) | |
tree | 679399be0e90df7f2e24fd054a6a6d2918f62d75 /prh-dmaap-client/src | |
parent | 8a762124d24555d50ce7455398ca3ac02fde1076 (diff) |
Names change of SSL config params
Change-Id: I719b38b76fec976c459bfca6ffdc6dd9c1d7b00c
Issue-ID: DCAEGEN2-953
Signed-off-by: Maciej Wejs <maciej.wejs@nokia.com>
Diffstat (limited to 'prh-dmaap-client/src')
5 files changed, 37 insertions, 45 deletions
diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java index 8691111d..7084d9c1 100644 --- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java +++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/config/DmaapCustomConfig.java @@ -50,19 +50,16 @@ public interface DmaapCustomConfig extends Serializable { String dmaapContentType(); @Value.Parameter - String keyFile(); + String trustStorePath(); @Value.Parameter - String trustStore(); + String trustStorePasswordPath(); @Value.Parameter - String trustStorePassword(); + String keyStorePath(); @Value.Parameter - String keyStore(); - - @Value.Parameter - String keyStorePassword(); + String keyStorePasswordPath(); @Value.Parameter Boolean enableDmaapCertAuth(); @@ -83,15 +80,13 @@ public interface DmaapCustomConfig extends Serializable { B dmaapContentType(String dmaapContentType); - B keyFile(String keyFile); - - B trustStore(String trustStore); + B trustStorePath(String trustStorePath); - B trustStorePassword(String trustStorePass); + B trustStorePasswordPath(String trustStorePasswordPath); - B keyStore(String keyStore); + B keyStorePath(String keyStore); - B keyStorePassword(String keyStorePass); + B keyStorePasswordPath(String keyStorePass); B enableDmaapCertAuth(Boolean enableDmaapCertAuth); diff --git a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactory.java b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactory.java index 68dda512..ed88efb5 100644 --- a/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactory.java +++ b/prh-dmaap-client/src/main/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactory.java @@ -74,8 +74,8 @@ public class DMaaPReactiveWebClientFactory { private SslContext createSslContext(DmaapConsumerConfiguration consumerConfiguration) throws SSLException { if (consumerConfiguration.enableDmaapCertAuth()) { return sslFactory.createSecureContext( - consumerConfiguration.keyStore(), consumerConfiguration.keyStorePassword(), - consumerConfiguration.trustStore(), consumerConfiguration.trustStorePassword() + consumerConfiguration.keyStorePath(), consumerConfiguration.keyStorePasswordPath(), + consumerConfiguration.trustStorePath(), consumerConfiguration.trustStorePasswordPath() ); } return sslFactory.createInsecureContext(); diff --git a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapConsumerConfigurationTest.java b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapConsumerConfigurationTest.java index 01d470a0..54193edd 100644 --- a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapConsumerConfigurationTest.java +++ b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapConsumerConfigurationTest.java @@ -44,11 +44,10 @@ class DmaapConsumerConfigurationTest { String consumerGroup = "other"; Integer timeoutMs = 1000; Integer messageLimit = 1000; - String keyFile = "keyFile"; - String trustStore = "trustStore"; - String trustStorePass = "trustPass"; - String keyStore = "keyStore"; - String keyStorePass = "keyPass"; + String trustStorePath = "trustStorePath"; + String trustStorePasswordPath = "trustStorePasswordPath"; + String keyStorePath = "keyStorePath"; + String keyStorePasswordPath = "keyStorePasswordPath"; Boolean enableDmaapCertAuth = true; // When @@ -64,11 +63,10 @@ class DmaapConsumerConfigurationTest { .consumerGroup(consumerGroup) .timeoutMs(timeoutMs) .messageLimit(messageLimit) - .keyFile(keyFile) - .trustStore(trustStore) - .trustStorePassword(trustStorePass) - .keyStore(keyStore) - .keyStorePassword(keyStorePass) + .trustStorePath(trustStorePath) + .trustStorePasswordPath(trustStorePasswordPath) + .keyStorePath(keyStorePath) + .keyStorePasswordPath(keyStorePasswordPath) .enableDmaapCertAuth(enableDmaapCertAuth) .build(); @@ -76,9 +74,10 @@ class DmaapConsumerConfigurationTest { assertEquals("DmaapConsumerConfiguration{" + "consumerId=1, consumerGroup=other, timeoutMs=1000, messageLimit=1000, dmaapHostName=localhost, " + "dmaapPortNumber=2222, dmaapTopicName=temp, dmaapProtocol=http, dmaapUserName=admin, " - + "dmaapUserPassword=admin, dmaapContentType=application/json, keyFile=keyFile, " - + "trustStore=trustStore, trustStorePassword=trustPass, keyStore=keyStore, " - + "keyStorePassword=keyPass, enableDmaapCertAuth=true}", configuration.toString()); + + "dmaapUserPassword=admin, dmaapContentType=application/json, " + + "trustStorePath=trustStorePath, trustStorePasswordPath=trustStorePasswordPath, " + + "keyStorePath=keyStorePath, keyStorePasswordPath=keyStorePasswordPath, enableDmaapCertAuth=true}", + configuration.toString()); } } diff --git a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapPublisherConfigurationTest.java b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapPublisherConfigurationTest.java index d6471381..472abec5 100644 --- a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapPublisherConfigurationTest.java +++ b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapPublisherConfigurationTest.java @@ -41,11 +41,10 @@ class DmaapPublisherConfigurationTest { String dmaapUserName = "admin"; String dmaapUserPassword = "admin"; String dmaapContentType = "application/json"; - String keyFile = "keyFile"; - String trustStore = "trustStore"; - String trustStorePass = "trustPass"; - String keyStore = "keyStore"; - String keyStorePass = "keyPass"; + String trustStorePath = "trustStorePath"; + String trustStorePasswordPath = "trustStorePasswordPath"; + String keyStorePath = "keyStorePath"; + String keyStorePasswordPath = "keyStorePasswordPath"; Boolean enableDmaapCertAuth = true; // When @@ -57,19 +56,18 @@ class DmaapPublisherConfigurationTest { .dmaapUserName(dmaapUserName) .dmaapUserPassword(dmaapUserPassword) .dmaapContentType(dmaapContentType) - .keyFile(keyFile) - .trustStore(trustStore) - .trustStorePassword(trustStorePass) - .keyStore(keyStore) - .keyStorePassword(keyStorePass) + .trustStorePath(trustStorePath) + .trustStorePasswordPath(trustStorePasswordPath) + .keyStorePath(keyStorePath) + .keyStorePasswordPath(keyStorePasswordPath) .enableDmaapCertAuth(enableDmaapCertAuth) .build(); // Then assertEquals("DmaapPublisherConfiguration{dmaapHostName=localhost, dmaapPortNumber=2222, " + "dmaapTopicName=temp, dmaapProtocol=http, dmaapUserName=admin, dmaapUserPassword=admin, " - + "dmaapContentType=application/json, keyFile=keyFile, trustStore=trustStore, " - + "trustStorePassword=trustPass, keyStore=keyStore, keyStorePassword=keyPass, " - + "enableDmaapCertAuth=true}", configuration.toString()); + + "dmaapContentType=application/json, trustStorePath=trustStorePath, " + + "trustStorePasswordPath=trustStorePasswordPath, keyStorePath=keyStorePath, " + + "keyStorePasswordPath=keyStorePasswordPath, enableDmaapCertAuth=true}", configuration.toString()); } } diff --git a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactoryTest.java b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactoryTest.java index 887d5d33..b2cd84c6 100644 --- a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactoryTest.java +++ b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/consumer/DMaaPReactiveWebClientFactoryTest.java @@ -77,10 +77,10 @@ class DMaaPReactiveWebClientFactoryTest { private DmaapConsumerConfiguration givenDmaapConfigurationWithSslEnabled() { DmaapConsumerConfiguration dmaapConsumerConfiguration = mock(DmaapConsumerConfiguration.class); when(dmaapConsumerConfiguration.enableDmaapCertAuth()).thenReturn(true); - when(dmaapConsumerConfiguration.keyStore()).thenReturn(KEY_STORE); - when(dmaapConsumerConfiguration.keyStorePassword()).thenReturn(KEY_STORE_PASS); - when(dmaapConsumerConfiguration.trustStore()).thenReturn(TRUST_STORE); - when(dmaapConsumerConfiguration.trustStorePassword()).thenReturn(TRUST_STORE_PASS); + 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); return dmaapConsumerConfiguration; } }
\ No newline at end of file |