summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2023-03-23 14:17:00 +0000
committermpriyank <priyank.maheshwari@est.tech>2023-03-23 14:17:04 +0000
commit221ee7ddfe4a0bce0bc8ad57907404429821bc3d (patch)
tree7756a756c2c04106b432e9db91b0d02702dec27b /src
parent73a5134d0a2b5992be04cd2b7af2b2e6ad4621ab (diff)
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 <priyank.maheshwari@est.tech>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java11
1 files changed, 6 insertions, 5 deletions
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<String, Object> eventPayload = new LinkedHashMap<>();
+ eventPayload.put("push-change-update", "{}");
+ avcEvent.setEvent(eventPayload);
log.debug("Avc Event Created ID: {}", avcEvent.getEventId());
return avcEvent;