From f11f294188ac8f1891c4468e2242462127c73930 Mon Sep 17 00:00:00 2001 From: mpriyank Date: Wed, 31 Jul 2024 16:29:01 +0100 Subject: Handle duplicate targets NcmpOut event - Accpted , Rejected and Pending targets in the NcmpOut response to have unique values hence changing the datastructre to Set. Issue-ID: CPS-2338 Change-Id: I24a109fad4c854eff1b052df38947cc121445bb9 Signed-off-by: mpriyank --- .../impl/cmnotificationsubscription/ncmp/NcmpOutEventMapper.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cps-ncmp-service/src/main/java') diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpOutEventMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpOutEventMapper.java index ffd4b014fb..afff9d1298 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpOutEventMapper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpOutEventMapper.java @@ -21,6 +21,8 @@ package org.onap.cps.ncmp.impl.cmnotificationsubscription.ncmp; import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; import java.util.List; import java.util.Map; import lombok.RequiredArgsConstructor; @@ -76,9 +78,9 @@ public class NcmpOutEventMapper { final Map dmiSubscriptionsPerDmi, final Data cmSubscriptionData) { - final List acceptedCmHandleIds = new ArrayList<>(); - final List pendingCmHandleIds = new ArrayList<>(); - final List rejectedCmHandleIds = new ArrayList<>(); + final Collection acceptedCmHandleIds = new HashSet<>(); + final Collection pendingCmHandleIds = new HashSet<>(); + final Collection rejectedCmHandleIds = new HashSet<>(); dmiSubscriptionsPerDmi.forEach((dmiPluginName, dmiSubscriptionDetails) -> { final CmSubscriptionStatus cmSubscriptionStatus = -- cgit