summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org
diff options
context:
space:
mode:
authorraviteja.karumuri <raviteja.karumuri@est.tech>2023-05-24 18:23:38 +0100
committerraviteja.karumuri <raviteja.karumuri@est.tech>2023-06-01 12:08:20 +0100
commit7272f11fa4a3876cf61451a21916a7244c2d045b (patch)
tree18be57cf71e4877da7df5f4b33c011645ad3b60d /src/test/groovy/org
parent4679c1c64a88ee65b0f86e14be32a8b82f8da469 (diff)
DMI-Plugin : Update batch endpoint (move url param into rest body)
Issue-ID: CPS-1636 Signed-off-by: raviteja.karumuri <raviteja.karumuri@est.tech> Change-Id: I787be1be899a69c0972ccfd17016e67eaf8a771a
Diffstat (limited to 'src/test/groovy/org')
-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