From 85b5178017e89c815af7792826f52a90814f5dba Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Fri, 30 Aug 2019 15:21:05 -0400 Subject: Integrate using Policy Type to find Matchable Utilize's Jim's helper class to pull from API policy types definitions so that Xacml PDP can determine which properties are "matchable". Override initialize to set translator parameters. Utilize the metadata section of ToscaProperties to store the matchable field. Updated Matchable Request to be dynamic with respect to the incoming resource attributes. Stored the policy types as JSON. Issue-ID: POLICY-1899 Change-Id: Icff3605495b0a34ebfcdfa54346095ce2d8468a4 Signed-off-by: Pamela Dragosh --- .../org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java | 4 +++- .../policy/xacml/pdp/application/guard/GuardPdpApplicationTest.java | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'applications/guard/src') diff --git a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java index ee992907..b224009a 100644 --- a/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java +++ b/applications/guard/src/test/java/org/onap/policy/xacml/pdp/application/guard/CoordinationTest.java @@ -48,6 +48,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runners.MethodSorters; +import org.onap.policy.common.endpoints.parameters.RestServerParameters; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.resources.TextFileUtils; @@ -68,6 +69,7 @@ public class CoordinationTest { private static final Logger LOGGER = LoggerFactory.getLogger(CoordinationTest.class); private static Properties properties = new Properties(); private static File propertiesFile; + private static RestServerParameters clientParams = new RestServerParameters(); private static XacmlApplicationServiceProvider service; private static DecisionRequest requestCl1Node1; @SuppressWarnings("unused") @@ -131,7 +133,7 @@ public class CoordinationTest { // Tell it to initialize based on the properties file // we just built for it. // - service.initialize(propertiesFile.toPath().getParent()); + service.initialize(propertiesFile.toPath().getParent(), clientParams); // // Load Decision Requests // 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 c4ae5ddb..a5c5ff41 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 @@ -50,6 +50,7 @@ import org.junit.FixMethodOrder; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.junit.runners.MethodSorters; +import org.onap.policy.common.endpoints.parameters.RestServerParameters; import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.resources.TextFileUtils; @@ -71,6 +72,7 @@ public class GuardPdpApplicationTest { private static final Logger LOGGER = LoggerFactory.getLogger(GuardPdpApplicationTest.class); private static Properties properties = new Properties(); private static File propertiesFile; + private static RestServerParameters clientParams = new RestServerParameters(); private static XacmlApplicationServiceProvider service; private static DecisionRequest requestVfCount1; private static DecisionRequest requestVfCount3; @@ -129,7 +131,7 @@ public class GuardPdpApplicationTest { // Tell it to initialize based on the properties file // we just built for it. // - service.initialize(propertiesFile.toPath().getParent()); + service.initialize(propertiesFile.toPath().getParent(), clientParams); // // Load Decision Requests // -- cgit 1.2.3-korg