From 7272f11fa4a3876cf61451a21916a7244c2d045b Mon Sep 17 00:00:00 2001 From: "raviteja.karumuri" Date: Wed, 24 May 2023 18:23:38 +0100 Subject: DMI-Plugin : Update batch endpoint (move url param into rest body) Issue-ID: CPS-1636 Signed-off-by: raviteja.karumuri Change-Id: I787be1be899a69c0972ccfd17016e67eaf8a771a --- .../rest/controller/DmiRestControllerSpec.groovy | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/test/groovy/org') 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 -- cgit 1.2.3-korg