Merge "Eliminate cmhandle-properties tag"
authorJoseph Keenan <joseph.keenan@est.tech>
Wed, 22 Jun 2022 09:16:56 +0000 (09:16 +0000)
committerGerrit Code Review <gerrit@onap.org>
Wed, 22 Jun 2022 09:16:56 +0000 (09:16 +0000)
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']