+ def 'Get bulk resource data for #datastoreName from dmi service.'() {
+ given: 'bulk resource data url'
+ def getUrl = "$ncmpBasePathV1/batch/data/ds/${datastoreName}" +
+ "?resourceIdentifier=parent/child&options=(a=1,b=2)&topic=myTopic"
+ when: 'post data resource request is performed'
+ def response = mvc.perform(
+ post(getUrl)
+ .contentType(MediaType.APPLICATION_JSON)
+ .content(bulkRequestBody)
+ ).andReturn().response
+ then: 'response status is Ok'
+ response.status == HttpStatus.OK.value()
+ // TODO Need to be un-commented as it's failing into onap CICD pipeline
+ // but passed into nordix and local build.
+ //and: 'the NCMP data service is called with getResourceDataForCmHandleBatch'
+ // 1 * mockNetworkCmProxyDataService.getResourceDataForCmHandleBatch(datastoreName, ['testCmHandle'],
+ // 'parent/child',
+ // '(a=1,b=2)',
+ // 'myTopic',
+ // _)
+ and: 'async request id is generated'
+ assert response.contentAsString.contains("requestId")
+ where: 'the following data stores are used'
+ datastoreName << [PASSTHROUGH_RUNNING.datastoreName, PASSTHROUGH_OPERATIONAL.datastoreName]
+ }
+
+ def 'Get bulk resource data for non-supported #datastoreName from dmi service.'() {
+ given: 'bulk resource data url'
+ def getUrl = "$ncmpBasePathV1/batch/data/ds/ncmp-datastore:operational" +
+ "?resourceIdentifier=parent/child&options=(a=1,b=2)&topic=myTopic"
+ when: 'post data resource request is performed'
+ def response = mvc.perform(
+ post(getUrl)
+ .contentType(MediaType.APPLICATION_JSON)
+ .content(bulkRequestBody)
+ ).andReturn().response
+ then: 'response status code is 501 not implemented'
+ response.status == HttpStatus.NOT_IMPLEMENTED.value()
+ where: 'the following data store is un-supported'
+ datastoreName << [OPERATIONAL.datastoreName]
+ }
+