diff options
author | tragait <rahul.tyagi@est.tech> | 2021-10-04 16:02:57 +0100 |
---|---|---|
committer | tragait <rahul.tyagi@est.tech> | 2021-10-06 15:21:12 +0100 |
commit | 907e3785a7cbaba28f5d4bf7ce3c4a7b47dff39e (patch) | |
tree | f726e5dcdd5e485dc3e840cb850504bc7c5df78e /src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy | |
parent | 9ee0feb24f8f75ce05cf9e34e4621cf2b226657e (diff) |
fix query param to options
Issue-ID: CPS-678
Signed-off-by: tragait <rahul.tyagi@est.tech>
Change-Id: I4ac72da512e2c7883920907137b8834ce20d4528
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 |