From ec5d74d52b3f7b10a5002be5bb9a386927300cfd Mon Sep 17 00:00:00 2001 From: mpriyank Date: Mon, 20 Mar 2023 10:55:32 +0000 Subject: Avc Event prop rename - rename the eventTarget property as eventSource as per the schema in the spike - fixed the integration test and sample file Issue-ID: CPS-1554 Change-Id: Ieb8b749c6f64d69d87cacadae17a4589e9908cf2 Signed-off-by: mpriyank --- cps-ncmp-events/src/main/resources/schemas/avc-event-schema-v1.json | 6 +++--- .../onap/cps/ncmp/api/impl/notifications/avc/AvcEventMapper.java | 2 +- .../impl/notifications/avc/AvcEventProducerIntegrationSpec.groovy | 2 +- cps-ncmp-service/src/test/resources/sampleAvcInputEvent.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cps-ncmp-events/src/main/resources/schemas/avc-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/avc-event-schema-v1.json index c8109ca17..0e9f25663 100644 --- a/cps-ncmp-events/src/main/resources/schemas/avc-event-schema-v1.json +++ b/cps-ncmp-events/src/main/resources/schemas/avc-event-schema-v1.json @@ -19,8 +19,8 @@ "description": "The time of the AVC event. The expected format is 'yyyy-MM-dd'T'HH:mm:ss.SSSZ'.", "type": "string" }, - "eventTarget": { - "description": "The target of the AVC event.", + "eventSource": { + "description": "The source of the AVC event.", "type": "string" }, "eventType": { @@ -43,7 +43,7 @@ "eventId", "eventCorrelationId", "eventTime", - "eventTarget", + "eventSource", "eventType", "eventSchema", "eventSchemaVersion" diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventMapper.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventMapper.java index 531de4641..b6dc46777 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventMapper.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventMapper.java @@ -38,7 +38,7 @@ public interface AvcEventMapper { @Mapping(source = "eventCorrelationId", target = "eventCorrelationId") @Mapping(source = "eventSchema", target = "eventSchema") @Mapping(source = "eventSchemaVersion", target = "eventSchemaVersion") - @Mapping(source = "eventTarget", target = "eventTarget") + @Mapping(source = "eventSource", target = "eventSource") @Mapping(source = "eventType", target = "eventType") AvcEvent toOutgoingAvcEvent(AvcEvent incomingAvcEvent); diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventProducerIntegrationSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventProducerIntegrationSpec.groovy index 0089f777d..744737080 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventProducerIntegrationSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/notifications/avc/AvcEventProducerIntegrationSpec.groovy @@ -77,7 +77,7 @@ class AvcEventProducerIntegrationSpec extends MessagingBaseSpec { and: 'timestamps match' assert testEventSent.eventTime == convertedAvcEvent.getEventTime() and: 'target matches' - assert testEventSent.eventTarget == convertedAvcEvent.getEventTarget() + assert testEventSent.eventSource == convertedAvcEvent.getEventSource() } } \ No newline at end of file diff --git a/cps-ncmp-service/src/test/resources/sampleAvcInputEvent.json b/cps-ncmp-service/src/test/resources/sampleAvcInputEvent.json index d7d252b9a..bda2b4e63 100644 --- a/cps-ncmp-service/src/test/resources/sampleAvcInputEvent.json +++ b/cps-ncmp-service/src/test/resources/sampleAvcInputEvent.json @@ -2,7 +2,7 @@ "eventId": "4cb32729-85e3-44d1-aa6e-c923b9b059a5", "eventCorrelationId": "68f15800-8ed4-4bae-9e53-27a9e03e1911", "eventTime": "2022-12-12T14:29:23.876+0000", - "eventTarget": "NCMP", + "eventSource": "NCMP", "eventType": "org.onap.cps.ncmp.event.model.AvcEvent", "eventSchema": "urn:cps:org.onap.cps.ncmp.event.model.AvcEvent", "eventSchemaVersion": "v1", -- cgit 1.2.3-korg