aboutsummaryrefslogtreecommitdiffstats
path: root/properties-node/provider/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'properties-node/provider/src/test')
-rw-r--r--properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java9
-rw-r--r--properties-node/provider/src/test/resources/test.txt3
2 files changed, 11 insertions, 1 deletions
diff --git a/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java b/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java
index f1e0ab62..a858c49b 100644
--- a/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java
+++ b/properties-node/provider/src/test/java/jtest/org/onap/ccsdk/sli/plugins/prop/TestPropertiesNode.java
@@ -5,7 +5,9 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
+import org.junit.Rule;
import org.junit.Test;
+import org.junit.contrib.java.lang.system.EnvironmentVariables;
import static org.junit.Assert.assertEquals;
import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
import org.onap.ccsdk.sli.core.sli.SvcLogicException;
@@ -16,6 +18,8 @@ import org.slf4j.LoggerFactory;
public class TestPropertiesNode {
private static final Logger log = LoggerFactory.getLogger(TestPropertiesNode.class);
+ @Rule
+ public EnvironmentVariables environmentVariables = new EnvironmentVariables();
@Test
public void testJSONFileParsing() throws SvcLogicException {
@@ -129,6 +133,10 @@ public class TestPropertiesNode {
@Test
public void testTXTFileParsing() throws SvcLogicException {
+
+ environmentVariables.set("deployer_pass", "sdncp-123");
+ assertEquals("sdncp-123", System.getenv("deployer_pass"));
+
SvcLogicContext ctx = new SvcLogicContext();
Map<String, String> p = new HashMap<String, String>();
@@ -147,6 +155,7 @@ public class TestPropertiesNode {
"access-information.l1-customer-handoff"),"_1000BASELX");
assertEquals(ctx.getAttribute("test-txt.service-data.avpn-ip-port-information.avpn-" +
"access-information.vlan-tag-control"),"_1Q");
+ assertEquals(ctx.getAttribute("test-txt.obfuscated-var"), "sdncp-123");
}
@Test
diff --git a/properties-node/provider/src/test/resources/test.txt b/properties-node/provider/src/test/resources/test.txt
index 79e8acff..68b916cb 100644
--- a/properties-node/provider/src/test/resources/test.txt
+++ b/properties-node/provider/src/test/resources/test.txt
@@ -27,4 +27,5 @@ service-data.avpn-ip-port-information.contracted-port-speed-units = Kbps
service-data.avpn-ip-port-information.endpoint-information.bundle-id = 33
service-data.avpn-ip-port-information.endpoint-information.interface-string = ae0
service-data.service-information.service-instance-id = ICORESITE-2751508
-service-data.service-information.service-type = AVPN \ No newline at end of file
+service-data.service-information.service-type = AVPN
+obfuscated-var=${deployer_pass}