Eliminate cmhandle-properties tag 61/129661/1
authormpriyank <priyank.maheshwari@est.tech>
Tue, 21 Jun 2022 15:31:23 +0000 (16:31 +0100)
committermpriyank <priyank.maheshwari@est.tech>
Tue, 21 Jun 2022 15:31:30 +0000 (16:31 +0100)
- 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>
cps-ncmp-events/src/main/resources/schemas/ncmp-event-schema-v1.json
cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/event/NcmpEventsCreatorSpec.groovy

index 4ddffea..05a0e93 100644 (file)
@@ -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
         }
index 04eb0bf..ae38714 100644 (file)
@@ -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']