From ee04ffd34d67563f1b33a4fbb1eb17e948725d0f Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Mon, 14 Feb 2022 10:08:16 +0000 Subject: Fix distribution to accommodate object values in policy metadata Issue-ID: POLICY-3832 Signed-off-by: zrrmmua Change-Id: I1cb539156acee3a63c9ffa432ec2371941bf9acd --- .../forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins/forwarding-plugins/src/main/java') diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java index 4d0a8f70..3a380843 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiPolicyForwarder.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. + * Copyright (C) 2019,2022 Nordix Foundation. * Modifications Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2021 Bell Canada. * ================================================================================ @@ -129,9 +129,11 @@ public class LifecycleApiPolicyForwarder implements PolicyForwarder { final var pdpPolicies = new PdpDeployPolicies(); final List policyIdentifierList = new ArrayList<>(); for (final Map policyMap : toscaServiceTemplate.getToscaTopologyTemplate().getPolicies()) { - final String policyId = policyMap.entrySet().iterator().next().getValue().getMetadata().get("policy-id"); + final String policyId = + String.valueOf(policyMap.entrySet().iterator().next().getValue().getMetadata().get("policy-id")); final String policyVersion = - policyMap.entrySet().iterator().next().getValue().getMetadata().get("policy-version"); + String.valueOf(policyMap.entrySet().iterator().next().getValue().getMetadata() + .get("policy-version")); final var toscaPolicyIdentifier = new ToscaConceptIdentifierOptVersion(policyId, policyVersion); policyIdentifierList.add(toscaPolicyIdentifier); -- cgit 1.2.3-korg