diff options
author | mpriyank <priyank.maheshwari@est.tech> | 2024-07-31 16:29:01 +0100 |
---|---|---|
committer | mpriyank <priyank.maheshwari@est.tech> | 2024-07-31 16:29:05 +0100 |
commit | f11f294188ac8f1891c4468e2242462127c73930 (patch) | |
tree | e31bd591fbe2175582eb0b5d76bf87d5025f6d88 /cps-ncmp-service/src/main | |
parent | b66c993cc2ab670db0f62afe22bb0b5020e5dc40 (diff) |
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 <priyank.maheshwari@est.tech>
Diffstat (limited to 'cps-ncmp-service/src/main')
-rw-r--r-- | cps-ncmp-service/src/main/java/org/onap/cps/ncmp/impl/cmnotificationsubscription/ncmp/NcmpOutEventMapper.java | 8 |
1 files changed, 5 insertions, 3 deletions
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<String, DmiCmSubscriptionDetails> dmiSubscriptionsPerDmi, final Data cmSubscriptionData) { - final List<String> acceptedCmHandleIds = new ArrayList<>(); - final List<String> pendingCmHandleIds = new ArrayList<>(); - final List<String> rejectedCmHandleIds = new ArrayList<>(); + final Collection<String> acceptedCmHandleIds = new HashSet<>(); + final Collection<String> pendingCmHandleIds = new HashSet<>(); + final Collection<String> rejectedCmHandleIds = new HashSet<>(); dmiSubscriptionsPerDmi.forEach((dmiPluginName, dmiSubscriptionDetails) -> { final CmSubscriptionStatus cmSubscriptionStatus = |