aboutsummaryrefslogtreecommitdiffstats
path: root/applications/monitoring/src
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/monitoring/src
parent654d36993c355ef2afef5e91666d6da2d77cae43 (diff)
parent432cec9fa6f143dad324cd11f62fb052c7da32b7 (diff)
Merge "Changes to handle PDPX deploy/undeploy"
Diffstat (limited to 'applications/monitoring/src')
-rw-r--r--applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java20
1 files changed, 19 insertions, 1 deletions
diff --git a/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java b/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
index cc11dcf6..9b26df16 100644
--- a/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
+++ b/applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java
@@ -27,6 +27,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import java.io.File;
import java.io.IOException;
import java.util.Iterator;
+import java.util.List;
import java.util.Properties;
import java.util.ServiceLoader;
@@ -41,6 +42,7 @@ import org.onap.policy.common.utils.coder.StandardCoder;
import org.onap.policy.common.utils.resources.TextFileUtils;
import org.onap.policy.models.decisions.concepts.DecisionRequest;
import org.onap.policy.models.decisions.concepts.DecisionResponse;
+import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicy;
import org.onap.policy.models.tosca.authorative.concepts.ToscaPolicyTypeIdentifier;
import org.onap.policy.pdp.xacml.application.common.TestUtils;
import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
@@ -161,7 +163,8 @@ public class MonitoringPdpApplicationTest {
//
// Now load the optimization policies
//
- TestUtils.loadPolicies("src/test/resources/vDNS.policy.input.yaml", service);
+ final List<ToscaPolicy> loadedPolicies = TestUtils.loadPolicies("src/test/resources/vDNS.policy.input.yaml",
+ service);
//
// Ask for a decision
//
@@ -174,6 +177,21 @@ public class MonitoringPdpApplicationTest {
// Dump it out as Json
//
LOGGER.info(gson.encode(response));
+ LOGGER.info("Now testing unloading of policy");
+ //
+ // Now unload it
+ //
+ for (ToscaPolicy policy : loadedPolicies) {
+ assertThat(service.unloadPolicy(policy)).isTrue();
+ }
+ //
+ // Ask for a decision
+ //
+ response = service.makeDecision(requestSinglePolicy);
+ LOGGER.info("Decision {}", response);
+
+ assertThat(response).isNotNull();
+ assertThat(response.getPolicies().size()).isEqualTo(0);
}
@Test