From 69e393da4cce52a0491fffff2dc81fbe59aeca08 Mon Sep 17 00:00:00 2001 From: Dan Timoney Date: Wed, 17 Feb 2021 15:25:45 -0500 Subject: Add new EnvProperties class Added new class EnvProperties, which extends java.util.Properties and supports property values containing embedded environment variable references. Updated code to use this class to load svclogic.properties, and updated dmaap listener to use that class to load dmaap listener configuration. Issue-ID: SDNC-1482 Signed-off-by: Dan Timoney Change-Id: I7538b719631d8c10c27d059aeb4f70ce92760ebd --- plugins/grToolkit/provider/pom.xml | 20 ++++++++++++++++++++ .../sli/plugins/grtoolkit/GrToolkitProvider.java | 3 ++- .../src/main/resources/gr-toolkit.properties | 2 +- .../src/test/resources/gr-toolkit.properties | 2 +- .../src/test/resources/single/gr-toolkit.properties | 2 +- .../src/test/resources/six/gr-toolkit.properties | 2 +- .../src/test/resources/three/gr-toolkit.properties | 2 +- 7 files changed, 27 insertions(+), 6 deletions(-) (limited to 'plugins/grToolkit/provider') diff --git a/plugins/grToolkit/provider/pom.xml b/plugins/grToolkit/provider/pom.xml index 5c77331c0..b44436697 100755 --- a/plugins/grToolkit/provider/pom.xml +++ b/plugins/grToolkit/provider/pom.xml @@ -118,6 +118,26 @@ + + org.apache.maven.plugins + maven-surefire-plugin + + + admin + admin + + + + + org.apache.maven.plugins + maven-failsafe-plugin + + + admin + admin + + + diff --git a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java index 5a8730bff..8da2f09ae 100755 --- a/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java +++ b/plugins/grToolkit/provider/src/main/java/org/onap/ccsdk/sli/plugins/grtoolkit/GrToolkitProvider.java @@ -45,6 +45,7 @@ import org.apache.commons.lang.StringUtils; import org.json.JSONArray; import org.json.JSONObject; import org.onap.ccsdk.sli.core.dblib.DbLibService; +import org.onap.ccsdk.sli.core.utils.common.EnvProperties; import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionManager; import org.onap.ccsdk.sli.plugins.grtoolkit.connection.ConnectionResponse; import org.onap.ccsdk.sli.plugins.grtoolkit.data.AdminHealth; @@ -183,7 +184,7 @@ public class GrToolkitProvider implements AutoCloseable, GrToolkitService, DataT */ private void setProperties() { log.info("Loading properties from {}", PROPERTIES_FILE); - properties = new Properties(); + properties = new EnvProperties(); File propertiesFile = new File(PROPERTIES_FILE); if(!propertiesFile.exists()) { log.warn("setProperties(): Properties file not found."); diff --git a/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties b/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties index e3463df08..bce40620e 100755 --- a/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/main/resources/gr-toolkit.properties @@ -24,7 +24,7 @@ adm.fqdn= adm.healthcheck=/healthcheck adm.port.http=8181 adm.port.ssl=8443 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=true controller.port.http=8181 controller.port.ssl=8443 diff --git a/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties index 52b19bf51..d3b15e70e 100755 --- a/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/gr-toolkit.properties @@ -24,7 +24,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties index cc7820e90..040f082df 100755 --- a/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/single/gr-toolkit.properties @@ -23,7 +23,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties index 54c9af742..f078634d3 100755 --- a/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/six/gr-toolkit.properties @@ -23,7 +23,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODK_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 diff --git a/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties b/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties index cc7820e90..040f082df 100755 --- a/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties +++ b/plugins/grToolkit/provider/src/test/resources/three/gr-toolkit.properties @@ -23,7 +23,7 @@ adm.fqdn=localhost adm.healthcheck=/adm/healthcheck adm.port.http=9999 adm.port.ssl=19999 -controller.credentials=admin:admin +controller.credentials=${ODL_USER}:${ODL_PASSWORD} controller.useSsl=false controller.port.http=9999 controller.port.ssl=19999 -- cgit 1.2.3-korg