diff options
author | 2024-03-04 16:23:25 +0000 | |
---|---|---|
committer | 2024-03-14 09:36:41 +0000 | |
commit | 9221f900486de11b8779a93c1e7517640b8fb8e0 (patch) | |
tree | f11cebc330317205f0a586c446358ac5df6e80dd | |
parent | e14fe9ab679998f40d7c46ff58702e5aa0545b07 (diff) |
Modify lcm events to include dataProducerIdentifier and moduleSetTag (CPS-1964 3)
Issue-ID: CPS-2114
Change-Id: I52ae18fe849801706491742818b316df9f8cb554
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
3 files changed, 23 insertions, 11 deletions
diff --git a/cps-ncmp-events/src/main/resources/schemas/lcm/lcm-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/lcm/lcm-event-schema-v1.json index e687303f8..bd0d90d04 100644 --- a/cps-ncmp-events/src/main/resources/schemas/lcm/lcm-event-schema-v1.json +++ b/cps-ncmp-events/src/main/resources/schemas/lcm/lcm-event-schema-v1.json @@ -43,6 +43,14 @@ "description": "alternative id for cmHandle (e.g. 3GPP FDN)", "type": "string" }, + "moduleSetTag": { + "description": "module set tag for cmHandle", + "type": "string" + }, + "dataProducerIdentifier": { + "description": "data producer identifier for cmHandle", + "type": "string" + }, "oldValues": { "$ref": "#/definitions/Values" }, diff --git a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreator.java b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreator.java index 23d508b07..fa27be158 100644 --- a/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreator.java +++ b/cps-ncmp-service/src/main/java/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreator.java @@ -96,6 +96,8 @@ public class LcmEventsCreator { final Event event = new Event(); event.setCmHandleId(eventCorrelationId); event.setAlternateId(targetNcmpServiceCmHandle.getAlternateId()); + event.setModuleSetTag(targetNcmpServiceCmHandle.getModuleSetTag()); + event.setDataProducerIdentifier(targetNcmpServiceCmHandle.getDataProducerIdentifier()); final CmHandleValuesHolder cmHandleValuesHolder = LcmEventsCreatorHelper.determineEventValues(targetNcmpServiceCmHandle, existingNcmpServiceCmHandle, lcmEventType); diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreatorSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreatorSpec.groovy index b7c3b873f..bef2963cf 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreatorSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/events/lcm/LcmEventsCreatorSpec.groovy @@ -174,18 +174,20 @@ class LcmEventsCreatorSpec extends Specification { assert result.eventId != null } - def 'Map the LcmEvent for alternate IDs when #scenario'() { - given: 'NCMP cm handle details with current and old alternate IDs' - def existingNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: existingAlternateId, compositeState: new CompositeState(dataSyncEnabled: false)) - def targetNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: targetAlternateId, compositeState: new CompositeState(dataSyncEnabled: false)) + def 'Map the LcmEvent for alternate ID, data producer identifier, and module set tag when they contain #scenario'() { + given: 'NCMP cm handle details with current and old values for alternate ID, module set tag, and data producer identifier' + def existingNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: existingAlternateId, moduleSetTag: existingModuleSetTag, dataProducerIdentifier: existingDataProducerIdentifier, compositeState: new CompositeState(dataSyncEnabled: false)) + def targetNcmpServiceCmHandle = new NcmpServiceCmHandle(cmHandleId: cmHandleId, alternateId: targetAlternateId, moduleSetTag: targetModuleSetTag, dataProducerIdentifier: targetDataProducerIdentifier, compositeState: new CompositeState(dataSyncEnabled: false)) when: 'the event is populated' def result = objectUnderTest.populateLcmEvent(cmHandleId, targetNcmpServiceCmHandle, existingNcmpServiceCmHandle) - then: 'the alternate ID is present or is an empty string in the payload' - assert result.event.alternateId == expectedEventAlternateId - where: 'the following alternate IDs are provided' - scenario | existingAlternateId | targetAlternateId || expectedEventAlternateId - 'same new and old alternate ID' | 'someAlternateId' | 'someAlternateId' || 'someAlternateId' - 'blank new and old alternate ID' | '' | '' || '' - 'new alternate id and blank old alternate ID' | '' | 'someAlternateId' || 'someAlternateId' + then: 'the alternate ID, module set tag, and data producer identifier are present or are an empty string in the payload' + assert result.event.alternateId == targetAlternateId + assert result.event.moduleSetTag == targetModuleSetTag + assert result.event.dataProducerIdentifier == targetDataProducerIdentifier + where: 'the following values are provided for the alternate ID, module set tag, and data producer identifier' + scenario | existingAlternateId | targetAlternateId | existingModuleSetTag | targetModuleSetTag | existingDataProducerIdentifier | targetDataProducerIdentifier + 'same target and existing values' | 'someAlternateId' | 'someAlternateId' | 'someModuleSetTag' | 'someModuleSetTag' | 'someDataProducerIdentifier' | 'someDataProducerIdentifier' + 'blank target and existing values' | '' | '' | '' | '' | '' | '' + 'new target value and blank existing values' | '' | 'someAlternateId' | '' | 'someAlternateId' | '' | 'someDataProducerIdentifier' } }
\ No newline at end of file |