def 'call get resource data for pass-through:operational datastore from DMI.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/data/ds' +
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
'/ncmp-datastore:passthrough-operational/testResourceId?fields=testFieldsQuery&depth=10'
when: 'get resource data is called to DMI'
objectUnderTest.getResourceDataOperationalFromDmi('testDmiBasePath',
}
def 'call get resource data for pass-through:running datastore from DMI.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/data/ds' +
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
'/ncmp-datastore:passthrough-running/testResourceId?fields=testFieldsQuery&depth=10'
when: 'get resource data is called to DMI'
objectUnderTest.getResourceDataPassThroughRunningFromDmi('testDmiBasePath',
}
def 'call create resource data for pass-through:running datastore from DMI.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/data/ds' +
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/data/ds' +
'/ncmp-datastore:passthrough-running/testResourceId'
when: 'get resource data is called to DMI'
objectUnderTest.createResourceDataPassThroughRunningFromDmi('testDmiBasePath',
def 'Call get resource from dmi.'() {
given: 'expected url'
- def expectedUrl = 'testDmiBasePath/dmi/api/v1/ch/testCmhandle/modules'
+ def expectedUrl = 'testDmiBasePath/dmi/v1/ch/testCmhandle/modules'
when: 'get resource data is called to dmi'
objectUnderTest.getResourceFromDmi('testDmiBasePath',
'testCmhandle',
then: 'the post operation is executed with the correct URL'
1 * mockDmiRestClient.postOperation(expectedUrl, _ as HttpHeaders)
}
+
+ 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)
+ }
}
\ No newline at end of file