summaryrefslogtreecommitdiffstats
path: root/src/test/groovy/org/onap/cps/ncmp/dmi/rest/controller/DmiRestControllerSpec.groovy
diff options
context:
space:
mode:
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.groovy12
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