aboutsummaryrefslogtreecommitdiffstats
path: root/applications/monitoring/src/test
diff options
context:
space:
mode:
Diffstat (limited to 'applications/monitoring/src/test')
-rw-r--r--applications/monitoring/src/test/java/org/onap/policy/xacml/pdp/application/monitoring/MonitoringPdpApplicationTest.java17
-rw-r--r--applications/monitoring/src/test/resources/xacml.properties2
2 files changed, 11 insertions, 8 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 4af4bac4..8099ffdd 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
@@ -46,6 +46,8 @@ 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.ToscaPolicyTypeIdentifier;
+import org.onap.policy.pdp.xacml.application.common.XacmlApplicationException;
import org.onap.policy.pdp.xacml.application.common.XacmlApplicationServiceProvider;
import org.onap.policy.pdp.xacml.application.common.XacmlPolicyUtils;
import org.slf4j.Logger;
@@ -131,11 +133,11 @@ public class MonitoringPdpApplicationTest {
// Ensure it has the supported policy types and
// can support the correct policy types.
//
- assertThat(service.canSupportPolicyType("onap.Monitoring", "1.0.0")).isTrue();
- assertThat(service.canSupportPolicyType("onap.Monitoring", "1.5.0")).isTrue();
- assertThat(service.canSupportPolicyType("onap.policies.monitoring.foobar", "1.0.1")).isTrue();
- assertThat(service.canSupportPolicyType("onap.foobar", "1.0.0")).isFalse();
- assertThat(service.supportedPolicyTypes()).contains("onap.Monitoring");
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier("onap.Monitoring", "1.0.0"))).isTrue();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier("onap.Monitoring", "1.5.0"))).isTrue();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ "onap.policies.monitoring.foobar", "1.0.1"))).isTrue();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier("onap.foobar", "1.0.0"))).isFalse();
//
// Ensure it supports decisions
//
@@ -156,7 +158,7 @@ public class MonitoringPdpApplicationTest {
@SuppressWarnings("unchecked")
@Test
- public void test3AddvDnsPolicy() throws IOException, CoderException {
+ public void test3AddvDnsPolicy() throws IOException, CoderException, XacmlApplicationException {
//
// Now load the vDNS Policy - make sure
// the pdp can support it and have it load
@@ -185,8 +187,9 @@ public class MonitoringPdpApplicationTest {
//
assertThat(policyDefinition.containsKey("type")).isTrue();
assertThat(service.canSupportPolicyType(
+ new ToscaPolicyTypeIdentifier(
policyDefinition.get("type").toString(),
- policyDefinition.get("version").toString()))
+ policyDefinition.get("version").toString())))
.isTrue();
}
}
diff --git a/applications/monitoring/src/test/resources/xacml.properties b/applications/monitoring/src/test/resources/xacml.properties
index 56a92d69..36eac3cd 100644
--- a/applications/monitoring/src/test/resources/xacml.properties
+++ b/applications/monitoring/src/test/resources/xacml.properties
@@ -22,5 +22,5 @@ xacml.att.policyFinderFactory=org.onap.policy.pdp.xacml.application.common.OnapP
# Policies to load
#
xacml.rootPolicies=monitoring
-monitoring.file=src/main/resources/RootMonitoringPolicy.xml
+monitoring.file=../../packages/policy-xacmlpdp-tarball/src/main/resources/apps/monitoring/RootMonitoringPolicy.xml