From 17b7235cdaca01a6d50d0b2bda6ceb2a239b8862 Mon Sep 17 00:00:00 2001 From: Daniel Silverthorn Date: Tue, 11 Dec 2018 13:07:50 -0500 Subject: Handle non-obfuscated config Change-Id: I5c57fcc16a93881af5cdf33947967e0d7ef2dd33 Issue-ID: AAI-1997 Signed-off-by: Daniel Silverthorn --- .../modelloader/config/TestModelLoaderConfig.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/test') diff --git a/src/test/java/org/onap/aai/modelloader/config/TestModelLoaderConfig.java b/src/test/java/org/onap/aai/modelloader/config/TestModelLoaderConfig.java index bfd793a..5243ac5 100644 --- a/src/test/java/org/onap/aai/modelloader/config/TestModelLoaderConfig.java +++ b/src/test/java/org/onap/aai/modelloader/config/TestModelLoaderConfig.java @@ -78,6 +78,9 @@ public class TestModelLoaderConfig { ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_PASSWORD, password); assertEquals(password, config.getPassword()); + + config = createUnobfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_PASSWORD, password); + assertEquals(password, config.getPassword()); } @Test @@ -86,6 +89,9 @@ public class TestModelLoaderConfig { ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD, password); assertEquals(password, config.getKeyStorePassword()); + + config = createUnobfuscatedTestConfig(ModelLoaderConfig.PROP_ML_DISTRIBUTION_KEYSTORE_PASSWORD, password); + assertEquals(password, config.getKeyStorePassword()); } @Test @@ -94,6 +100,9 @@ public class TestModelLoaderConfig { ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_AUTHENTICATION_PASSWORD, password); assertEquals(password, config.getAaiAuthenticationPassword()); + + config = createUnobfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_AUTHENTICATION_PASSWORD, password); + assertEquals(password, config.getAaiAuthenticationPassword()); } @Test @@ -101,6 +110,9 @@ public class TestModelLoaderConfig { String password = "myvoiceismypassword"; ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_KEYSTORE_PASSWORD, password); assertEquals(password, config.getAaiKeyStorePassword()); + + config = createUnobfuscatedTestConfig(ModelLoaderConfig.PROP_AAI_KEYSTORE_PASSWORD, password); + assertEquals(password, config.getAaiKeyStorePassword()); } @Test @@ -117,6 +129,9 @@ public class TestModelLoaderConfig { String password = "babelpassword"; ModelLoaderConfig config = createObfuscatedTestConfig(ModelLoaderConfig.PROP_BABEL_KEYSTORE_PASSWORD, password); assertEquals(password, config.getBabelKeyStorePassword()); + + config = createUnobfuscatedTestConfig(ModelLoaderConfig.PROP_BABEL_KEYSTORE_PASSWORD, password); + assertEquals(password, config.getBabelKeyStorePassword()); } @Test @@ -190,4 +205,10 @@ public class TestModelLoaderConfig { props.put(propertyName, Password.obfuscate(propertyValue)); return new ModelLoaderConfig(props, null); } + + private ModelLoaderConfig createUnobfuscatedTestConfig(String propertyName, String propertyValue) { + Properties props = new Properties(); + props.put(propertyName, propertyValue); + return new ModelLoaderConfig(props, null); + } } -- cgit 1.2.3-korg