diff options
Diffstat (limited to 'cps-ncmp-service/src/test')
3 files changed, 10 insertions, 6 deletions
diff --git a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/data/operation/ResourceDataOperationRequestUtilsSpec.groovy b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/data/operation/ResourceDataOperationRequestUtilsSpec.groovy index c866824062..38b2056d00 100644 --- a/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/data/operation/ResourceDataOperationRequestUtilsSpec.groovy +++ b/cps-ncmp-service/src/test/groovy/org/onap/cps/ncmp/api/impl/utils/data/operation/ResourceDataOperationRequestUtilsSpec.groovy @@ -110,9 +110,9 @@ class ResourceDataOperationRequestUtilsSpec extends MessagingBaseSpec { toTargetEvent(consumerRecordOut.value(), DataOperationEvent.class) and: 'data operation response event response size is 3' dataOperationResponseEvent.data.responses.size() == 3 - and: 'verify published response data as json string' - jsonObjectMapper.asJsonString(dataOperationResponseEvent.data.responses) - == '[{"operationId":"operational-14","ids":["unknown-cm-handle"],"statusCode":"100","statusMessage":"cm handle id(s) not found"},{"operationId":"operational-14","ids":["non-ready-cm handle"],"statusCode":"101","statusMessage":"cm handle(s) not ready"},{"operationId":"running-12","ids":["non-ready-cm handle"],"statusCode":"101","statusMessage":"cm handle(s) not ready"}]' + and: 'verify published data operation response as json string' + def dataOperationResponseEventJson = TestUtils.getResourceFileContent('dataOperationResponseEvent.json') + jsonObjectMapper.asJsonString(dataOperationResponseEvent.data.responses) == dataOperationResponseEventJson } static def getYangModelCmHandles() { @@ -126,7 +126,7 @@ class ResourceDataOperationRequestUtilsSpec extends MessagingBaseSpec { new YangModelCmHandle(id: 'ch3-dmi2', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: readyState), new YangModelCmHandle(id: 'ch4-dmi2', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: readyState), new YangModelCmHandle(id: 'ch7-dmi2', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: readyState), - new YangModelCmHandle(id: 'non-ready-cm handle', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: advisedState) + new YangModelCmHandle(id: 'non-ready-cm-handle', dmiServiceName: 'dmi2', dmiProperties: dmiProperties, compositeState: advisedState) ] } } diff --git a/cps-ncmp-service/src/test/resources/dataOperationRequest.json b/cps-ncmp-service/src/test/resources/dataOperationRequest.json index d2e0d64892..f69b87631f 100644 --- a/cps-ncmp-service/src/test/resources/dataOperationRequest.json +++ b/cps-ncmp-service/src/test/resources/dataOperationRequest.json @@ -10,18 +10,20 @@ "ch3-dmi2", "unknown-cm-handle", "ch6-dmi1", - "non-ready-cm handle" + "non-ready-cm-handle" ] }, { "operation": "read", "operationId": "running-12", "datastore": "ncmp-datastore:passthrough-running", + "options": "some option", + "resourceIdentifier": "some resource identifier", "targetIds": [ "ch1-dmi1", "ch7-dmi2", "ch2-dmi1", - "non-ready-cm handle" + "non-ready-cm-handle" ] }, { @@ -29,6 +31,7 @@ "operationId": "operational-15", "datastore": "ncmp-datastore:passthrough-operational", "options": "some option", + "resourceIdentifier": "some resource identifier", "targetIds": [ "ch4-dmi2", "ch6-dmi1" diff --git a/cps-ncmp-service/src/test/resources/dataOperationResponseEvent.json b/cps-ncmp-service/src/test/resources/dataOperationResponseEvent.json new file mode 100644 index 0000000000..611d47d1a3 --- /dev/null +++ b/cps-ncmp-service/src/test/resources/dataOperationResponseEvent.json @@ -0,0 +1 @@ +[{"operationId":"operational-14","ids":["unknown-cm-handle"],"resourceIdentifier":"some resource identifier","options":"some option","statusCode":"100","statusMessage":"cm handle id(s) not found"},{"operationId":"operational-14","ids":["non-ready-cm-handle"],"resourceIdentifier":"some resource identifier","options":"some option","statusCode":"101","statusMessage":"cm handle(s) not ready"},{"operationId":"running-12","ids":["non-ready-cm-handle"],"resourceIdentifier":"some resource identifier","options":"some option","statusCode":"101","statusMessage":"cm handle(s) not ready"}]
\ No newline at end of file |