From fca2e06f2a01c03ba0d12271defaec0b5ab13ba5 Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Fri, 11 Feb 2022 08:53:57 +0000 Subject: Fix xacml pdp to accommodate Object values in policy metadata Issue-ID: POLICY-3832 Signed-off-by: zrrmmua Change-Id: I276bf28d3fdaad6e1d7cde315cdb049343cbde3f --- .../onap/policy/xacml/pdp/application/guard/GuardTranslator.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'applications/guard/src/main') diff --git a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java index 3aae5fc4..45caf21c 100644 --- a/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java +++ b/applications/guard/src/main/java/org/onap/policy/xacml/pdp/application/guard/GuardTranslator.java @@ -129,7 +129,7 @@ public class GuardTranslator implements ToscaPolicyTranslator { // // Policy name should be at the root // - String policyName = toscaPolicy.getMetadata().get("policy-id"); + String policyName = String.valueOf(toscaPolicy.getMetadata().get("policy-id")); // // Set it as the policy ID // @@ -275,14 +275,14 @@ public class GuardTranslator implements ToscaPolicyTranslator { * @param map The Metadata TOSCA Map * @return Same Policy Object */ - protected PolicyType fillMetadataSection(PolicyType policy, Map map) { + protected PolicyType fillMetadataSection(PolicyType policy, Map map) { // // NOTE: The models code ensures the metadata section ALWAYS exists // // // Add in the Policy Version // - policy.setVersion(map.get("policy-version")); + policy.setVersion(String.valueOf(map.get("policy-version"))); return policy; } -- cgit 1.2.3-korg