.content(jsonData)
).andReturn().response
then: 'the cm handles are registered with the service'
- 1 * mockNetworkCmProxyDataService.updateDmiPluginRegistration(_)
+ 1 * mockNetworkCmProxyDataService.updateDmiRegistrationAndSyncModule(_)
and: 'response status is created'
response.status == HttpStatus.CREATED.value()
}
and: 'response contains valid object body'
response.getContentAsString() == '{valid-json}'
}
+
+ def 'Create Resource Data from pass-through running using POST.' () {
+ given: 'resource data url'
+ def getUrl = "$basePath/v1/ch/testCmHandle/data/ds/ncmp-datastore:passthrough-running" +
+ "/testResourceIdentifier"
+ when: 'get data resource request is performed'
+ def response = mvc.perform(
+ post(getUrl)
+ .contentType(MediaType.APPLICATION_JSON_VALUE)
+ .accept(MediaType.APPLICATION_JSON_VALUE).content('{"some-json":"value"}')
+ ).andReturn().response
+ then: 'ncmp service method to create resource called'
+ 1 * mockNetworkCmProxyDataService.createResourceDataPassThroughRunningForCmHandle('testCmHandle',
+ 'testResourceIdentifier', ['some-json':'value'], 'application/json;charset=UTF-8')
+ and: 'resource is created'
+ response.status == HttpStatus.CREATED.value()
+ }
}