From 95357cd3145e8a7b5f7e46b7ce4d4262b1a443a9 Mon Sep 17 00:00:00 2001 From: JulienBe Date: Tue, 16 Jun 2020 19:18:16 +0200 Subject: improve test coverage Issue-ID: SDC-3120 Signed-off-by: JulienBe Change-Id: I8e02fcb3f495d70c14e6e9cf0304085d77918805 --- .../org/onap/config/api/ConfigurationTest.java | 56 ++++++++++++++++++++++ 1 file changed, 56 insertions(+) (limited to 'common/onap-common-configuration-management/onap-configuration-management-api') 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 @@ -72,6 +72,62 @@ public class ConfigurationTest { Assert.assertNull(Configuration.TENANT.get()); } + @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"; -- cgit 1.2.3-korg