summaryrefslogtreecommitdiffstats
path: root/policy-endpoints/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'policy-endpoints/src/test/java/org')
-rw-r--r--policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java
index e1c0dbcf..7e5c3a12 100644
--- a/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java
+++ b/policy-endpoints/src/test/java/org/onap/policy/common/endpoints/utils/ParameterUtilsTest.java
@@ -22,6 +22,7 @@ package org.onap.policy.common.endpoints.utils;
import static org.junit.Assert.assertEquals;
+import java.util.Arrays;
import java.util.Properties;
import org.junit.Test;
import org.onap.policy.common.endpoints.parameters.CommonTestData;
@@ -52,4 +53,21 @@ public class ParameterUtilsTest {
assertEquals(CommonTestData.TOPIC_SERVER, topicProperties
.getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + ".servers"));
}
+
+ @Test
+ public void testUpdateTopicProperties() {
+ Properties topicProperties = new Properties();
+ ParameterUtils.updateTopicProperties(topicProperties, "source", CommonTestData.TOPIC_INFRA,
+ CommonTestData.TOPIC_NAME, Arrays.asList(CommonTestData.TOPIC_SERVER));
+ assertEquals(CommonTestData.TOPIC_NAME,
+ topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".source.topics"));
+ assertEquals(CommonTestData.TOPIC_SERVER, topicProperties
+ .getProperty(CommonTestData.TOPIC_INFRA + ".source.topics." + CommonTestData.TOPIC_NAME + ".servers"));
+ ParameterUtils.updateTopicProperties(topicProperties, "sink", CommonTestData.TOPIC_INFRA,
+ CommonTestData.TOPIC_NAME, Arrays.asList(CommonTestData.TOPIC_SERVER));
+ assertEquals(CommonTestData.TOPIC_NAME,
+ topicProperties.getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics"));
+ assertEquals(CommonTestData.TOPIC_SERVER, topicProperties
+ .getProperty(CommonTestData.TOPIC_INFRA + ".sink.topics." + CommonTestData.TOPIC_NAME + ".servers"));
+ }
}