summaryrefslogtreecommitdiffstats
path: root/applications/guard/src/test/java
diff options
context:
space:
mode:
authorJorge Hernandez <jorge.hernandez-herrero@att.com>2019-04-10 14:20:47 +0000
committerGerrit Code Review <gerrit@onap.org>2019-04-10 14:20:47 +0000
commitbfb8d12818346b96c9ab918e72327e1d13662321 (patch)
tree1f55b2dd72d4629593d20fd3d3cee52db231c25b /applications/guard/src/test/java
parentccb1828ec3e1a1c9071256f85f3876a8d1c8ecdf (diff)
parente034d785a227815f66138d1f83f49624c402aa97 (diff)
Merge "Test decision from main entry"
Diffstat (limited to 'applications/guard/src/test/java')
-rw-r--r--applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java25
1 files changed, 15 insertions, 10 deletions
diff --git a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java
index 0e5d8593..be0ee2db 100644
--- a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java
+++ b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java
@@ -54,7 +54,9 @@ 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.OnapOperationsHistoryDbao;
+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;
@@ -214,13 +216,15 @@ public class GuardPdpApplicationTest {
//
assertThat(service.supportedPolicyTypes()).isNotEmpty();
assertThat(service.supportedPolicyTypes().size()).isEqualTo(2);
- assertThat(service.canSupportPolicyType("onap.policies.controlloop.guard.FrequencyLimiter", "1.0.0"))
- .isTrue();
- assertThat(service.canSupportPolicyType("onap.policies.controlloop.guard.FrequencyLimiter", "1.0.1"))
- .isFalse();
- assertThat(service.canSupportPolicyType("onap.policies.controlloop.guard.MinMax", "1.0.0")).isTrue();
- assertThat(service.canSupportPolicyType("onap.policies.controlloop.guard.MinMax", "1.0.1")).isFalse();
- assertThat(service.canSupportPolicyType("onap.foo", "1.0.1")).isFalse();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ "onap.policies.controlloop.guard.FrequencyLimiter", "1.0.0"))).isTrue();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ "onap.policies.controlloop.guard.FrequencyLimiter", "1.0.1"))).isFalse();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ "onap.policies.controlloop.guard.MinMax", "1.0.0"))).isTrue();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier(
+ "onap.policies.controlloop.guard.MinMax", "1.0.1"))).isFalse();
+ assertThat(service.canSupportPolicyType(new ToscaPolicyTypeIdentifier("onap.foo", "1.0.1"))).isFalse();
}
@Test
@@ -230,7 +234,8 @@ public class GuardPdpApplicationTest {
}
@Test
- public void test3FrequencyLimiter() throws CoderException, FileNotFoundException, IOException {
+ public void test3FrequencyLimiter() throws CoderException, FileNotFoundException, IOException,
+ XacmlApplicationException {
LOGGER.info("**************** Running test3 ****************");
//
// Now load the vDNS frequency limiter Policy - make sure
@@ -271,7 +276,7 @@ public class GuardPdpApplicationTest {
}
@Test
- public void test4MinMax() throws CoderException, FileNotFoundException, IOException {
+ public void test4MinMax() throws CoderException, FileNotFoundException, IOException, XacmlApplicationException {
LOGGER.info("**************** Running test4 ****************");
//
// Now load the vDNS min max Policy - make sure
@@ -317,7 +322,7 @@ public class GuardPdpApplicationTest {
}
@Test
- public void test5MissingFields() throws FileNotFoundException, IOException {
+ public void test5MissingFields() throws FileNotFoundException, IOException, XacmlApplicationException {
LOGGER.info("**************** Running test5 ****************");
//
// Most likely we would not get a policy with missing fields passed to