aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulienBe <julien.bertozzi@intl.att.com>2020-06-16 19:18:16 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-06-19 10:59:06 +0000
commit95357cd3145e8a7b5f7e46b7ce4d4262b1a443a9 (patch)
tree49c27518e4793c8fcc98c5b04fc3c002fad0d65b
parent54532f7f7c45241327691925ab6d68226d124815 (diff)
improve test coverage
Issue-ID: SDC-3120 Signed-off-by: JulienBe <julien.bertozzi@intl.att.com> Change-Id: I8e02fcb3f495d70c14e6e9cf0304085d77918805
-rw-r--r--common/onap-common-configuration-management/onap-configuration-management-api/src/test/java/org/onap/config/api/ConfigurationTest.java56
1 files changed, 56 insertions, 0 deletions
diff --git a/common/onap-common-configuration-management/onap-configuration-management-api/src/test/java/org/onap/config/api/ConfigurationTest.java b/common/onap-common-configuration-management/onap-configuration-management-api/src/test/java/org/onap/config/api/ConfigurationTest.java
index 7e3fd5d2c9..6ceffe7131 100644
--- a/common/onap-common-configuration-management/onap-configuration-management-api/src/test/java/org/onap/config/api/ConfigurationTest.java
+++ b/common/onap-common-configuration-management/onap-configuration-management-api/src/test/java/org/onap/config/api/ConfigurationTest.java
@@ -73,6 +73,62 @@ public class ConfigurationTest {
}
@Test
+ public void testGetAsStringValues() {
+ Assert.assertEquals(0, configuration.getAsStringValues("key").size());
+ Assert.assertEquals(0, configuration.getAsStringValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsStringValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsByteValues() {
+ Assert.assertEquals(0, configuration.getAsByteValues("key").size());
+ Assert.assertEquals(0, configuration.getAsByteValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsByteValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsShortValues() {
+ Assert.assertEquals(0, configuration.getAsShortValues("key").size());
+ Assert.assertEquals(0, configuration.getAsShortValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsShortValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsIntegerValues() {
+ Assert.assertEquals(0, configuration.getAsIntegerValues("key").size());
+ Assert.assertEquals(0, configuration.getAsIntegerValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsIntegerValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsDoubleValues() {
+ Assert.assertEquals(0, configuration.getAsDoubleValues("key").size());
+ Assert.assertEquals(0, configuration.getAsDoubleValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsDoubleValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsFloatValues() {
+ Assert.assertEquals(0, configuration.getAsFloatValues("key").size());
+ Assert.assertEquals(0, configuration.getAsFloatValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsFloatValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsBooleanValues() {
+ Assert.assertEquals(0, configuration.getAsBooleanValues("key").size());
+ Assert.assertEquals(0, configuration.getAsBooleanValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsBooleanValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
+ public void testGetAsCharacterValues() {
+ Assert.assertEquals(0, configuration.getAsCharacterValues("key").size());
+ Assert.assertEquals(0, configuration.getAsCharacterValues("namespace", "key").size());
+ Assert.assertEquals(0, configuration.getAsCharacterValues("tenantId", "namespace", "key").size());
+ }
+
+ @Test
public void tenantDoesNotPropagateToAnotherThread() throws ExecutionException, InterruptedException {
final String currentTenant = "xyz";
Configuration.setTenantId(currentTenant);