From 221ee7ddfe4a0bce0bc8ad57907404429821bc3d Mon Sep 17 00:00:00 2001 From: mpriyank Date: Thu, 23 Mar 2023 14:17:00 +0000 Subject: Fix Avc event creator - adhere to changes in the Avc event schema in cps-and-ncmp repo. - Update cps version dependency in dmi-plugin Issue-ID: CPS-1578 Change-Id: I6749aac437b7954725e5a3a7887ec260cb5e733e Signed-off-by: mpriyank --- pom.xml | 2 +- .../ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 3d88aa6b..e6c8c66b 100644 --- a/pom.xml +++ b/pom.xml @@ -40,7 +40,7 @@ org.onap.cps.ncmp.dmi.Application ${docker.pull.registry}/onap/integration-java11:8.0.0 - 3.2.1 + 3.2.6 ${project.version}-${maven.build.timestamp} 0.98 yyyyMMdd'T'HHmmss'Z' diff --git a/src/main/java/org/onap/cps/ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java b/src/main/java/org/onap/cps/ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java index 6902b2eb..03ed1c4c 100644 --- a/src/main/java/org/onap/cps/ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java +++ b/src/main/java/org/onap/cps/ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java @@ -22,10 +22,11 @@ package org.onap.cps.ncmp.dmi.notifications.avc; import java.time.ZonedDateTime; import java.time.format.DateTimeFormatter; +import java.util.LinkedHashMap; +import java.util.Map; import java.util.UUID; import lombok.extern.slf4j.Slf4j; import org.onap.cps.ncmp.event.model.AvcEvent; -import org.onap.cps.ncmp.event.model.Event; /** * Helper to create AvcEvents. @@ -49,12 +50,12 @@ public class DmiDataAvcEventCreator { avcEvent.setEventType(AvcEvent.class.getName()); avcEvent.setEventSchema("urn:cps:" + AvcEvent.class.getName()); avcEvent.setEventSchemaVersion("v1"); - avcEvent.setEventTarget("NCMP"); + avcEvent.setEventSource("NCMP"); avcEvent.setEventTime(ZonedDateTime.now().format(dateTimeFormatter)); - final Event event = new Event(); - event.setAdditionalProperty("payload", "Hello world!"); - avcEvent.setEvent(event); + final Map eventPayload = new LinkedHashMap<>(); + eventPayload.put("push-change-update", "{}"); + avcEvent.setEvent(eventPayload); log.debug("Avc Event Created ID: {}", avcEvent.getEventId()); return avcEvent; -- cgit 1.2.3-korg