+
+ def 'Call get resource from dmi with json data.'() {
+ given: 'expected url & json data'
+ def requestBody = 'some json'
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmHandle/modules'
+ def expectedHttpHeaders = new HttpHeaders()
+ when: 'get resource data is called to dmi'
+ objectUnderTest.getResourceFromDmiWithJsonData('testDmiBasePath',
+ requestBody,
+ 'testCmHandle',
+ 'modules')
+ then: 'the post operation is executed with the correct URL and json data'
+ 1 * mockDmiRestClient.postOperationWithJsonData(expectedUrl, requestBody, expectedHttpHeaders)
+ }
+
+ def 'Update resource data for pass-through:running datastore from DMI.'() {
+ given: 'the expected url'
+ def cmHandle = 'some-cmhandle'
+ def resourceIdentifier = 'parent/child'
+ def expectedUrl = 'some-dmi-service-name/dmi/v1/ch/' + cmHandle + '/data/ds' +
+ '/ncmp-datastore:passthrough-running?resourceIdentifier=' + resourceIdentifier
+ when: 'replace resource data is called for DMI'
+ objectUnderTest.updateResourceDataPassThroughRunningFromDmi('some-dmi-service-name',
+ cmHandle,
+ resourceIdentifier,
+ 'some-json-body')
+ then: 'the post operation is executed with the correct URL'
+ 1 * mockDmiRestClient.postOperationWithJsonData(expectedUrl, 'some-json-body', _ as HttpHeaders)
+ }