summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpriyank <priyank.maheshwari@est.tech>2022-06-21 16:31:23 +0100
committermpriyank <priyank.maheshwari@est.tech>2022-06-21 16:31:30 +0100
commit81d917dde44ea902b2ecf22e217e9551299f414e (patch)
tree4869d3c0310ac65bb84cb551bc969a4f1799b3de
parentaffb95e48d7bf80a2062eb8228b816846a99f977 (diff)
Eliminate cmhandle-properties tag
- Eliminate the cmhandle-properties tag in case of DELETE operation - Fixed Test cases corresponding to that Issue-ID: CPS-1098 Change-Id: Icd5e08403e0b101baf682f5e558c36ee4ebfd5c3 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
-rw-r--r--cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json1
-rw-r--r--cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/NcmpEventsCreatorSpec.groovy4
2 files changed, 3 insertions, 2 deletions
diff --git a/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json b/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
index 4ddffea56a..05a0e93b31 100644
--- a/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
+++ b/cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
@@ -72,6 +72,7 @@
"cmhandle-properties": {
"description": "cmHandle properties as json object.",
"type": "object",
+ "default": null,
"existingJavaType": "java.util.List<java.util.Map<String,String>>",
"additionalProperties": false
}
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/NcmpEventsCreatorSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/NcmpEventsCreatorSpec.groovy
index 04eb0bf2bb..ae38714e25 100644
--- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/NcmpEventsCreatorSpec.groovy
+++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/NcmpEventsCreatorSpec.groovy
@@ -45,8 +45,8 @@ class NcmpEventsCreatorSpec extends Specification {
assert result.eventCorrelationId == cmHandleId
and: 'event payload is mapped correctly'
assert result.event.operation == operation
- assert result.event.cmhandleProperties.size() == cmHandlePropertiesListSize
- assert result.event.cmhandleProperties[0] == cmHandleProperties
+ assert (result.event.cmhandleProperties != null) ? result.event.cmhandleProperties.size() : 0 == cmHandlePropertiesListSize
+ assert (result.event.cmhandleProperties != null) ? result.event.cmhandleProperties[0] : null == cmHandleProperties
where: 'the following operations are used'
operation | cmHandlePropertiesListSize | cmHandleProperties
CREATE | 1 | ['publicProperty1': 'value1', 'publicProperty2': 'value2']