aboutsummaryrefslogtreecommitdiffstats
path: root/prh-dmaap-client/src/test
diff options
context:
space:
mode:
authorPrzemyslaw Wasala <przemyslaw.wasala@nokia.com>2018-10-26 05:55:08 +0000
committerGerrit Code Review <gerrit@onap.org>2018-10-26 05:55:08 +0000
commit361f6112f3316f66f1a20a994db0996975080a25 (patch)
treed147d10f590cbf4c1b72457d35de3291c866bcd3 /prh-dmaap-client/src/test
parent0acd2676d1410f2e0ae6d203dbd594befbc9f2c1 (diff)
parent48c86d015c5a12cd54101d703d021d953d81509f (diff)
Merge "certificate configuration for DMaaP and AAI"
Diffstat (limited to 'prh-dmaap-client/src/test')
-rw-r--r--prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapConsumerConfigurationTest.java57
-rw-r--r--prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/prh/service/config/DmaapPublisherConfigurationTest.java43
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());
}
}