From 7edbeb6d5853206cc1d3b4cadd7ba50e96f4f04d Mon Sep 17 00:00:00 2001 From: Renu Kumari Date: Mon, 30 Aug 2021 07:45:52 -0400 Subject: Change the list-node rest interface - Changed the list-node interface to be consistent with datanode api Issue-ID: CPS-598 Signed-off-by: Renu Kumari Change-Id: Ic99828f1463e9a724244c05166e477581756f602 --- .../onap/cps/rest/controller/DataRestControllerSpec.groovy | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cps-rest/src/test/groovy') diff --git a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy index 1d51ec4ac..a54f3bc95 100755 --- a/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy +++ b/cps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy @@ -150,7 +150,7 @@ class DataRestControllerSpec extends Specification { def parentNodeXpath = 'parent node xpath' def jsonData = 'json data' when: 'post is invoked list-node endpoint' - def postRequestBuilder = post("$dataNodeBaseEndpoint/anchors/$anchorName/list-node") + def postRequestBuilder = post("$dataNodeBaseEndpoint/anchors/$anchorName/list-nodes") .contentType(MediaType.APPLICATION_JSON) .param('xpath', parentNodeXpath) .content(jsonData) @@ -307,14 +307,14 @@ class DataRestControllerSpec extends Specification { given: 'parent node xpath and json data inputs' def parentNodeXpath = 'parent node xpath' def jsonData = 'json data' - when: 'patch is invoked list-node endpoint' - def patchRequestBuilder = patch("$dataNodeBaseEndpoint/anchors/$anchorName/list-node") + when: 'put is invoked list-node endpoint' + def putRequestBuilder = put("$dataNodeBaseEndpoint/anchors/$anchorName/list-nodes") .contentType(MediaType.APPLICATION_JSON) .param('xpath', parentNodeXpath) .content(jsonData) if (observedTimestamp != null) - patchRequestBuilder.param('observed-timestamp', observedTimestamp) - def response = mvc.perform(patchRequestBuilder).andReturn().response + putRequestBuilder.param('observed-timestamp', observedTimestamp) + def response = mvc.perform(putRequestBuilder).andReturn().response then: 'a success response is returned' response.status == expectedHttpStatus.value() and: 'the java API was called with the correct parameters' @@ -331,7 +331,7 @@ class DataRestControllerSpec extends Specification { given: 'list node xpath' def listNodeXpath = 'list node xpath' when: 'delete is invoked list-node endpoint' - def deleteRequestBuilder = delete("$dataNodeBaseEndpoint/anchors/$anchorName/list-node") + def deleteRequestBuilder = delete("$dataNodeBaseEndpoint/anchors/$anchorName/list-nodes") .param('xpath', listNodeXpath) if (observedTimestamp != null) deleteRequestBuilder.param('observed-timestamp', observedTimestamp) -- cgit 1.2.3-korg