summaryrefslogtreecommitdiffstats
path: root/cps-rest
diff options
context:
space:
mode:
authorRenu Kumari <renu.kumari@bell.ca>2021-08-30 07:45:52 -0400
committerRenu Kumari <renu.kumari@bell.ca>2021-08-30 09:00:07 -0400
commit7edbeb6d5853206cc1d3b4cadd7ba50e96f4f04d (patch)
tree3a721f6f092a4c2516e37526250774e35932e0d3 /cps-rest
parentc584bf2729bb6eb9229aad9dbacc65beaa5dbc2f (diff)
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 <renu.kumari@bell.ca> Change-Id: Ic99828f1463e9a724244c05166e477581756f602
Diffstat (limited to 'cps-rest')
-rw-r--r--cps-rest/src/main/resources/static/cpsData.yml2
-rw-r--r--cps-rest/src/main/resources/static/openapi.yml2
-rwxr-xr-xcps-rest/src/test/groovy/org/onap/cps/rest/controller/DataRestControllerSpec.groovy12
3 files changed, 8 insertions, 8 deletions
diff --git a/cps-rest/src/main/resources/static/cpsData.yml b/cps-rest/src/main/resources/static/cpsData.yml
index 75d954473d..77673cb0f8 100644
--- a/cps-rest/src/main/resources/static/cpsData.yml
+++ b/cps-rest/src/main/resources/static/cpsData.yml
@@ -72,7 +72,7 @@ listNodeByDataspaceAndAnchor:
'403':
$ref: 'components.yml#/components/responses/Forbidden'
- patch:
+ put:
description: Replace list-node child elements under existing node for a given anchor and dataspace
tags:
- cps-data
diff --git a/cps-rest/src/main/resources/static/openapi.yml b/cps-rest/src/main/resources/static/openapi.yml
index 8fa640cf9b..922cabb01e 100644
--- a/cps-rest/src/main/resources/static/openapi.yml
+++ b/cps-rest/src/main/resources/static/openapi.yml
@@ -67,7 +67,7 @@ paths:
/v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/nodes:
$ref: 'cpsData.yml#/nodesByDataspaceAndAnchor'
- /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-node:
+ /v1/dataspaces/{dataspace-name}/anchors/{anchor-name}/list-nodes:
$ref: 'cpsData.yml#/listNodeByDataspaceAndAnchor'
/v1/dataspaces/{dataspace-name}/nodes:
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 1d51ec4aca..a54f3bc95d 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)