aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/mountpoint-registrar/provider
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-02-23 07:20:02 +0100
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-02-23 07:20:33 +0100
commitf0f6564eddb19286454130e9d645228bca38d98b (patch)
tree0ea0c3223bb2a1d850c6776425c64beef6f2ce93 /sdnr/wt/mountpoint-registrar/provider
parentf333557c8bf0a74eb7b88d6294dea2a420b1ec61 (diff)
VES fault read from DMaaP fails
VES eventtime now read from the mandatory field in commoneventheader Issue-ID: CCSDK-3157 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: I7bbfddcbb2c0c6fbb1b91b2a2e5e16fd5703ad56 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/mountpoint-registrar/provider')
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java6
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPFaultVESMsgConsumer.java8
2 files changed, 8 insertions, 6 deletions
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java
index b9cd5fc1a..ec5198012 100644
--- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java
+++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java
@@ -21,6 +21,8 @@ package org.onap.ccsdk.features.sdnr.wt.mountpointregistrar.impl;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
+import java.time.Instant;
+import java.time.ZoneId;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SeverityType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -59,8 +61,8 @@ public class DMaaPFaultVESMsgConsumer extends DMaaPVESMsgConsumerImpl {
return;
}
faultNodeId = dmaapMessageRootNode.at("/event/commonEventHeader/sourceName").textValue();
- faultOccurrenceTime =
- dmaapMessageRootNode.at("/event/faultFields/alarmAdditionalInformation/eventTime").textValue();
+ faultOccurrenceTime = Instant.ofEpochMilli(dmaapMessageRootNode.at("/event/commonEventHeader/startEpochMicrosec").longValue()/1000)
+ .atZone(ZoneId.of("Z")).toString();
faultObjectId = dmaapMessageRootNode.at("/event/faultFields/alarmInterfaceA").textValue();
faultReason = dmaapMessageRootNode.at("/event/faultFields/specificProblem").textValue();
faultSeverity = dmaapMessageRootNode.at("/event/faultFields/eventSeverity").textValue();
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPFaultVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPFaultVESMsgConsumer.java
index 0d9f107a8..cf25e1e7b 100644
--- a/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPFaultVESMsgConsumer.java
+++ b/sdnr/wt/mountpoint-registrar/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/test/TestDMaaPFaultVESMsgConsumer.java
@@ -44,8 +44,8 @@ public class TestDMaaPFaultVESMsgConsumer {
+ " \"reportingEntityName\":\"1e9a28bcd119_50007\","
+ " \"sourceId\":\"\","
+ " \"sourceName\":\"1e9a28bcd119_50007\","
- + " \"startEpochMicrosec\":94801033822670,"
- + " \"lastEpochMicrosec\":94801033822670,"
+ + " \"startEpochMicrosec\":1614004128699785,"
+ + " \"lastEpochMicrosec\":1614004128699785,"
+ " \"nfNamingCode\":\"sdn controller\","
+ " \"nfVendorName\":\"sdn\","
+ " \"timeZoneOffset\":\"+00:00\","
@@ -86,8 +86,8 @@ public class TestDMaaPFaultVESMsgConsumer {
+ " \"reportingEntityName\":\"1e9a28bcd119_50007\","
+ " \"sourceId\":\"\","
+ " \"sourceName\":\"1e9a28bcd119_50007\","
- + " \"startEpochMicrosec\":94801033822670,"
- + " \"lastEpochMicrosec\":94801033822670,"
+ + " \"startEpochMicrosec\":1612349525626,"
+ + " \"lastEpochMicrosec\":1612349525626,"
+ " \"nfNamingCode\":\"sdn controller\","
+ " \"nfVendorName\":\"sdn\","
+ " \"timeZoneOffset\":\"+00:00\","