aboutsummaryrefslogtreecommitdiffstats
path: root/applications/common/src/test/java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-04-11 23:08:28 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-11 23:08:28 +0000
commit578c96027a8ba1bde8b50b45d4b846daf61ecfd5 (patch)
treea5bdf1a1687980ce1f670b913fcf8a5478cfc512 /applications/common/src/test/java
parent654d36993c355ef2afef5e91666d6da2d77cae43 (diff)
parent432cec9fa6f143dad324cd11f62fb052c7da32b7 (diff)
Merge "Changes to handle PDPX deploy/undeploy"
Diffstat (limited to 'applications/common/src/test/java')
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
index fe0f675d..ed63bb9c 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/XacmlPolicyUtilsTest.java
@@ -225,7 +225,7 @@ public class XacmlPolicyUtilsTest {
}
@Test
- public void testRemovingProperties() {
+ public void testRemovingReferencedProperties() {
//
// Dump what we are starting with
//
@@ -261,4 +261,27 @@ public class XacmlPolicyUtilsTest {
XacmlPolicyUtils.debugDumpPolicyProperties(properties, LOGGER);
assertThat(properties.getProperty("refstart4.file")).isNullOrEmpty();
}
+
+ @Test
+ public void testRemovingRootProperties() {
+ //
+ // Dump what we are starting with
+ //
+ XacmlPolicyUtils.debugDumpPolicyProperties(properties, LOGGER);
+ //
+ // Remove root policies
+ //
+ Path ref = Paths.get("src/test/resources/root.xml");
+ XacmlPolicyUtils.removeRootPolicy(properties, ref);
+ XacmlPolicyUtils.debugDumpPolicyProperties(properties, LOGGER);
+ assertThat(properties.getProperty("root.file")).isNullOrEmpty();
+
+ //
+ // Test one that isn't in there
+ //
+ ref = Paths.get("src/test/resources/NotThere.xml");
+ XacmlPolicyUtils.removeRootPolicy(properties, ref);
+ XacmlPolicyUtils.debugDumpPolicyProperties(properties, LOGGER);
+ assertThat(properties.getProperty("refstart3.file")).isNotBlank();
+ }
}