Changing resource identifier to a query param
[cps.git] / cps-ncmp-service / src / test / groovy / org / onap / cps / ncmp / api / impl / operation / DmiOperationsSpec.groovy
index 6a1ce1a..8af7781 100644 (file)
@@ -42,11 +42,11 @@ class DmiOperationsSpec extends Specification {
     def 'call get resource data for pass-through:operational datastore from DMI.'() {
         given: 'expected url'
         def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
-                '/ncmp-datastore:passthrough-operational/testResourceId?fields=testFieldsQuery&depth=10'
+                '/ncmp-datastore:passthrough-operational?resourceIdentifier=parent/child&fields=testFieldsQuery&depth=10'
         when: 'get resource data is called to DMI'
         objectUnderTest.getResourceDataOperationalFromDmi('testDmiBasePath',
                 'testCmhandle',
-                'testResourceId',
+                'parent/child',
                 'testFieldsQuery',
                 10,
                 'testAcceptJson',
@@ -57,11 +57,11 @@ class DmiOperationsSpec extends Specification {
     def 'call get resource data for pass-through:running datastore from DMI.'() {
         given: 'expected url'
         def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
-                '/ncmp-datastore:passthrough-running/testResourceId?fields=testFieldsQuery&depth=10'
+                '/ncmp-datastore:passthrough-running?resourceIdentifier=parent/child&fields=testFieldsQuery&depth=10'
         when: 'get resource data is called to DMI'
         objectUnderTest.getResourceDataPassThroughRunningFromDmi('testDmiBasePath',
                 'testCmhandle',
-                'testResourceId',
+                'parent/child',
                 'testFieldsQuery',
                 10,
                 'testAcceptJson',
@@ -72,11 +72,11 @@ class DmiOperationsSpec extends Specification {
     def 'call create resource data for pass-through:running datastore from DMI.'() {
         given: 'expected url'
         def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
-                '/ncmp-datastore:passthrough-running/testResourceId'
+                '/ncmp-datastore:passthrough-running?resourceIdentifier=parent/child'
         when: 'get resource data is called to DMI'
         objectUnderTest.createResourceDataPassThroughRunningFromDmi('testDmiBasePath',
                 'testCmhandle',
-                'testResourceId',
+                'parent/child',
                 'testJsonbody')
         then: 'the put operation is executed with the correct URL'
         1 * mockDmiRestClient.postOperationWithJsonData(expectedUrl, 'testJsonbody', _ as HttpHeaders)