diff options
Diffstat (limited to 'common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config')
-rw-r--r-- | common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/CliConfigurationImpTest.java | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/CliConfigurationImpTest.java b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/CliConfigurationImpTest.java index 3d12eac13d..897583f605 100644 --- a/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/CliConfigurationImpTest.java +++ b/common/onap-common-configuration-management/onap-configuration-management-core/src/test/java/org/onap/config/CliConfigurationImpTest.java @@ -19,8 +19,10 @@ package org.onap.config; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; +import java.util.HashMap; import java.util.Map; +import org.junit.Assert; import org.junit.Test; import org.onap.config.api.ConfigurationManager; import org.onap.config.impl.CliConfigurationImpl; @@ -51,6 +53,30 @@ public class CliConfigurationImpTest { assertEquals("org.junit.Test", testServiceImpl.getImplementationClass()); } + @Test + public void listConfigurationNullQueryShouldntFailWithNPETest() { + ConfigurationManager conf = new CliConfigurationImpl(); + Assert.assertEquals(0, conf.listConfiguration(null).size()); + } + + @Test + public void listConfigurationEmptyQueryTest() { + ConfigurationManager conf = new CliConfigurationImpl(); + Assert.assertEquals(0, conf.listConfiguration(new HashMap<>()).size()); + } + + @Test + public void getConfigurationValueNullQueryShouldntFailWithNPETest() { + ConfigurationManager conf = new CliConfigurationImpl(); + Assert.assertNull (conf.getConfigurationValue(null)); + } + + @Test + public void getConfigurationValueEmptyQueryTest() { + ConfigurationManager conf = new CliConfigurationImpl(); + Assert.assertNull (conf.getConfigurationValue(new HashMap<>())); + } + private void validateCliMapConfig(Map outputMap) { assertEquals("appc", outputMap.get(withoutArtifactPrefix(ConfigTestConstant.ARTIFACT_CONSUMER))); |