summaryrefslogtreecommitdiffstats
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
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>
-rw-r--r--pom.xml2
-rw-r--r--src/main/java/org/onap/cps/ncmp/dmi/notifications/avc/DmiDataAvcEventCreator.java11
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 @@
<properties>
<app>org.onap.cps.ncmp.dmi.Application</app>
<base.image>${docker.pull.registry}/onap/integration-java11:8.0.0</base.image>
- <cps.version>3.2.1</cps.version>
+ <cps.version>3.2.6</cps.version>
<image.tag>${project.version}-${maven.build.timestamp}</image.tag>
<jacoco.minimum.coverage>0.98</jacoco.minimum.coverage>
<maven.build.timestamp.format>yyyyMMdd'T'HHmmss'Z'</maven.build.timestamp.format>
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;