diff options
author | Niamh Core <niamh.core@est.tech> | 2021-10-07 10:45:52 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-10-07 10:45:52 +0000 |
commit | f0acf5b1a4dd4bb774a81a7a75c48aeb81169fde (patch) | |
tree | 85e713048590d011b800ced414a3e6f400451fa1 /src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy | |
parent | 7da71ea56c2c7067296d5875be3ddc0101e745c9 (diff) | |
parent | 907e3785a7cbaba28f5d4bf7ce3c4a7b47dff39e (diff) |
Merge "fix query param to options"
Diffstat (limited to 'src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy')
-rw-r--r-- | src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy | 12 |
1 files changed, 5 insertions, 7 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 256db4e9..3bc1f3be 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 @@ -198,7 +198,7 @@ class DmiRestControllerSpec extends Specification { def 'Get resource data for pass-through operational from cm handle.'() { given: 'Get resource data url' def getResourceDataForCmHandleUrl = "${basePathV1}/ch/some-cmHandle/data/ds/ncmp-datastore:passthrough-operational" + - "?resourceIdentifier=abc/xyz&fields=myfields&depth=5" + "?resourceIdentifier=parent/child&options=(fields=myfields,depth=5)" def json = '{"cmHandleProperties" : { "prop1" : "value1", "prop2" : "value2"}}' when: 'get resource data PUT api is invoked' def response = mvc.perform( @@ -209,10 +209,9 @@ class DmiRestControllerSpec extends Specification { response.status == HttpStatus.OK.value() and: 'dmi service called with get resource data for cm handle' 1 * mockDmiService.getResourceDataOperationalForCmHandle('some-cmHandle', - 'abc/xyz', + 'parent/child', 'application/json', - 'myfields', - 5, + '(fields=myfields,depth=5)', ['prop1': 'value1', 'prop2': 'value2']) } @@ -243,7 +242,7 @@ class DmiRestControllerSpec extends Specification { def 'Get resource data for pass-through running from cm handle with #scenario value in resource identifier param.'() { given: 'Get resource data url' def getResourceDataForCmHandleUrl = "${basePathV1}/ch/some-cmHandle/data/ds/ncmp-datastore:passthrough-running" + - "?resourceIdentifier="+resourceIdentifier+"&fields=testFields&depth=5" + "?resourceIdentifier="+resourceIdentifier+"&options=(fields=myfields,depth=5)" def json = '{"cmHandleProperties" : { "prop1" : "value1", "prop2" : "value2"}}' when: 'get resource data PUT api is invoked' def response = mvc.perform( @@ -256,8 +255,7 @@ class DmiRestControllerSpec extends Specification { 1 * mockDmiService.getResourceDataPassThroughRunningForCmHandle('some-cmHandle', resourceIdentifier, 'application/json', - 'testFields', - 5, + '(fields=myfields,depth=5)', ['prop1':'value1', 'prop2':'value2']) where: 'tokens are used in the resource identifier parameter' scenario | resourceIdentifier |