summaryrefslogtreecommitdiffstats
path: root/common/onap-common-configuration-management/onap-configuration-management-core/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/test')
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/ConfigurationUtilsTest.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/ConfigurationUtilsTest.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/ConfigurationUtilsTest.java
new file mode 100644
index 0000000000..90966fccf6
--- /dev/null
+++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/ConfigurationUtilsTest.java
@@ -0,0 +1,32 @@
+package org.onap.config;
+
+import org.junit.Test;
+
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+public class ConfigurationUtilsTest {
+ @Test
+ public void testCommaList() {
+ List list = Arrays.asList("1", "2", 3);
+ String commaSeparatedList = ConfigurationUtils.getCommaSeparatedList(list);
+ list.forEach(o -> assertTrue(commaSeparatedList.contains(o.toString())));
+ }
+
+ @Test
+ public void testCommaListWithNullAndEmptyStrings() {
+ List list = Arrays.asList(null, "", " ");
+ String commaSeparatedList = ConfigurationUtils.getCommaSeparatedList(list);
+ assertTrue(commaSeparatedList.isEmpty());
+ }
+
+ @Test
+ public void testGetArrayClassFunction() {
+ assertEquals(String[].class , ConfigurationUtils.getArrayClass(String.class));
+ assertNull(ConfigurationUtils.getArrayClass(ConfigurationUtilsTest.class));
+ }
+} \ No newline at end of file