summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org/onap
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/groovy/org/onap')
-rw-r--r--src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy
index acc8b63b..8499ae25 100644
--- a/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy
+++ b/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy
@@ -1,6 +1,6 @@
/*
* ============LICENSE_START=======================================================
- * Copyright (C) 2021-2022 Nordix Foundation
+ * Copyright (C) 2021-2023 Nordix Foundation
* Modifications Copyright (C) 2021-2022 Bell Canada
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -312,18 +312,17 @@ class DmiRestControllerSpec extends Specification {
}
- def 'Get resource data for a collection of cm handles (unimplemented).'() {
- given: 'an endpoint for adding a batch of cm handle Ids'
- def url = "$basePathV1/ch/batch/data/ds/test-datastore?topic=test"
- and: 'a request body'
- def body = '{"CmHandles": []}'
- when: 'the endpoint is invoked'
+ def 'Get resource data for a list of operations.'() {
+ given: 'an endpoint for a batch data request with list of cmhandles in request body'
+ def resourceDataUrl = "$basePathV1/data?topic=client-topic-name&requestId=some-requestId"
+ and: 'list of operation details are received into request body'
+ def batchDataRequestBody = '[{"operation": "read", "operationId": "14", "datastore": "ncmp-datastore:passthrough-operational", "options": "some options", "resourceIdentifier": "some resourceIdentifier",' +
+ ' "cmhandles": [ {"id": "cmHanlde123", "cmHandleProperties": { "myProp`": "some value", "otherProp": "other value"}}]}]'
+ when: 'the dmi resource data for batch operation api is called.'
def response = mvc.perform(
- post(url)
- .contentType(MediaType.APPLICATION_JSON)
- .content(body)
+ post(resourceDataUrl).contentType(MediaType.APPLICATION_JSON).content(batchDataRequestBody)
).andReturn().response
- then: 'the response status code is 501'
+ then: 'the batch data endpoint returns the not implemented response'
assert response.status == 501
}
-}
+} \ No newline at end of file