diff options
Diffstat (limited to 'cps-ncmp-rest/src/test/groovy')
-rw-r--r-- | cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy index ea3c16d4cb..45e8f11948 100644 --- a/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy +++ b/cps-ncmp-rest/src/test/groovy/org/onap/cps/ncmp/rest/controller/NetworkCmProxyControllerSpec.groovy @@ -105,6 +105,23 @@ class NetworkCmProxyControllerSpec extends Specification { 'parent node xpath' | '/xpath' || '/xpath' } + def 'Add list-node elements.'() { + given: 'json data and parent node xpath' + def jsonData = 'json data' + def parentNodeXpath = 'parent node xpath' + when: 'post request is performed' + def response = mvc.perform( + post("$dataNodeBaseEndpoint/cm-handles/$cmHandle/list-node") + .contentType(MediaType.APPLICATION_JSON) + .content(jsonData) + .param('xpath', parentNodeXpath) + ).andReturn().response + then: 'the service method is invoked once with expected parameters' + 1 * mockNetworkCmProxyDataService.addListNodeElements(cmHandle, parentNodeXpath, jsonData) + and: 'response status indicates success' + response.status == HttpStatus.CREATED.value() + } + def 'Update data node leaves.'() { given: 'json data' def jsonData = 'json data' |