diff options
author | 2018-10-25 14:56:21 +0200 | |
---|---|---|
committer | 2018-10-25 15:34:45 +0200 | |
commit | 48c86d015c5a12cd54101d703d021d953d81509f (patch) | |
tree | 67d9960571ccaf7eb3904d58202dfdb0723f2cf1 /prh-dmaap-client/src/test | |
parent | 20ac34b8be76066810647a78dbca92120d2b6a8d (diff) |
certificate configuration for DMaaP and AAI
Change-Id: If074b4b1b5dce0dd5a69cd464cf6259177580736
Issue-ID: DCAEGEN2-888
Signed-off-by: Pawel <piotr.karas@nokia.com>
Diffstat (limited to 'prh-dmaap-client/src/test')
2 files changed, 60 insertions, 40 deletions
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 2239d110..01d470a0 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 @@ -20,7 +20,8 @@ package org.onap.dcaegen2.services.prh.service.config; -import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; + import org.junit.jupiter.api.Test; import org.onap.dcaegen2.services.prh.config.DmaapConsumerConfiguration; import org.onap.dcaegen2.services.prh.config.ImmutableDmaapConsumerConfiguration; @@ -43,33 +44,41 @@ 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"; + Boolean enableDmaapCertAuth = true; // When configuration = new ImmutableDmaapConsumerConfiguration.Builder() - .consumerId(consumerId) - .dmaapHostName(dmaapHostName) - .dmaapPortNumber(dmaapPortNumber) - .dmaapTopicName(dmaapTopicName) - .dmaapProtocol(dmaapProtocol) - .dmaapUserName(dmaapUserName) - .dmaapUserPassword(dmaapUserPassword) - .dmaapContentType(dmaapContentType) - .consumerGroup(consumerGroup) - .timeoutMs(timeoutMs) - .messageLimit(messageLimit) - .build(); + .consumerId(consumerId) + .dmaapHostName(dmaapHostName) + .dmaapPortNumber(dmaapPortNumber) + .dmaapTopicName(dmaapTopicName) + .dmaapProtocol(dmaapProtocol) + .dmaapUserName(dmaapUserName) + .dmaapUserPassword(dmaapUserPassword) + .dmaapContentType(dmaapContentType) + .consumerGroup(consumerGroup) + .timeoutMs(timeoutMs) + .messageLimit(messageLimit) + .keyFile(keyFile) + .trustStore(trustStore) + .trustStorePassword(trustStorePass) + .keyStore(keyStore) + .keyStorePassword(keyStorePass) + .enableDmaapCertAuth(enableDmaapCertAuth) + .build(); // Then - Assertions.assertNotNull(configuration); - Assertions.assertEquals(consumerId, configuration.consumerId()); - Assertions.assertEquals(dmaapHostName, configuration.dmaapHostName()); - Assertions.assertEquals(dmaapPortNumber, configuration.dmaapPortNumber()); - Assertions.assertEquals(dmaapTopicName, configuration.dmaapTopicName()); - Assertions.assertEquals(dmaapProtocol, configuration.dmaapProtocol()); - Assertions.assertEquals(dmaapUserName, configuration.dmaapUserName()); - Assertions.assertEquals(dmaapUserPassword, configuration.dmaapUserPassword()); - Assertions.assertEquals(consumerGroup, configuration.consumerGroup()); - Assertions.assertEquals(timeoutMs, configuration.timeoutMs()); - Assertions.assertEquals(messageLimit, configuration.messageLimit()); + 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()); + } } 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 f4a8f107..d6471381 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 @@ -20,7 +20,8 @@ package org.onap.dcaegen2.services.prh.service.config; -import org.junit.jupiter.api.Assertions; +import static org.junit.jupiter.api.Assertions.assertEquals; + import org.junit.jupiter.api.Test; import org.onap.dcaegen2.services.prh.config.DmaapPublisherConfiguration; import org.onap.dcaegen2.services.prh.config.ImmutableDmaapPublisherConfiguration; @@ -40,25 +41,35 @@ 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"; + Boolean enableDmaapCertAuth = true; // When configuration = new ImmutableDmaapPublisherConfiguration.Builder() - .dmaapHostName(dmaapHostName) - .dmaapPortNumber(dmaapPortNumber) - .dmaapTopicName(dmaapTopicName) - .dmaapProtocol(dmaapProtocol) - .dmaapUserName(dmaapUserName) - .dmaapUserPassword(dmaapUserPassword) - .dmaapContentType(dmaapContentType) - .build(); + .dmaapHostName(dmaapHostName) + .dmaapPortNumber(dmaapPortNumber) + .dmaapTopicName(dmaapTopicName) + .dmaapProtocol(dmaapProtocol) + .dmaapUserName(dmaapUserName) + .dmaapUserPassword(dmaapUserPassword) + .dmaapContentType(dmaapContentType) + .keyFile(keyFile) + .trustStore(trustStore) + .trustStorePassword(trustStorePass) + .keyStore(keyStore) + .keyStorePassword(keyStorePass) + .enableDmaapCertAuth(enableDmaapCertAuth) + .build(); // Then - Assertions.assertNotNull(configuration); - Assertions.assertEquals(dmaapHostName, configuration.dmaapHostName()); - Assertions.assertEquals(dmaapPortNumber, configuration.dmaapPortNumber()); - Assertions.assertEquals(dmaapTopicName, configuration.dmaapTopicName()); - Assertions.assertEquals(dmaapProtocol, configuration.dmaapProtocol()); - Assertions.assertEquals(dmaapUserName, configuration.dmaapUserName()); - Assertions.assertEquals(dmaapUserPassword, configuration.dmaapUserPassword()); + 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()); } } |