- scenario | datastoreInUrl | topicQueryParam || expectedTopicName | expectedNumberOfExecutorExecutions
- 'url with valid topic' | 'passthrough-operational' | '&topic=my-topic-name' || 'my-topic-name' | 1
- 'no topic in url' | 'passthrough-operational' | '' || NO_TOPIC | 0
- 'null topic in url' | 'passthrough-operational' | '&topic=null' || 'null' | 1
- 'url with valid topic' | 'passthrough-running' | '&topic=my-topic-name' || 'my-topic-name' | 1
- 'no topic in url' | 'passthrough-running' | '' || NO_TOPIC | 0
- 'null topic in url' | 'passthrough-running' | '&topic=null' || 'null' | 1
- }
-
- def 'Fail to get Resource Data from #datastoreInUrl when #scenario.'() {
- given: 'resource data url'
- def getUrl = "$ncmpBasePathV1/ch/testCmHandle/data/ds/ncmp-datastore:${datastoreInUrl}" +
- "?resourceIdentifier=parent/child&options=(a=1,b=2)${topicQueryParam}"
- when: 'get data resource request is performed'
- def response = mvc.perform(
- get(getUrl).contentType(MediaType.APPLICATION_JSON)).andReturn().response
- then: 'abad request is returned'
- response.status == HttpStatus.BAD_REQUEST.value()
- where: 'the following parameters are used'
- scenario | datastoreInUrl | topicQueryParam
- 'empty topic in url' | 'passthrough-operational' | '&topic=\"\"'
- 'missing topic in url' | 'passthrough-operational' | '&topic='
- 'blank topic value in url' | 'passthrough-operational' | '&topic=\" \"'
- 'invalid non-empty topic value in url' | 'passthrough-operational' | '&topic=1_5_*_#'
- 'empty topic in url' | 'passthrough-running' | '&topic=\"\"'
- 'missing topic in url' | 'passthrough-running' | '&topic='
- 'blank topic value in url' | 'passthrough-running' | '&topic=\" \"'
- 'invalid non-empty topic value in url' | 'passthrough-running' | '&topic=1_5_*_#'
- }
-
- 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'
+ scenario | additionalUrlParam || expectedIncludeDescendants
+ 'no additional param' | '' || OMIT_DESCENDANTS
+ 'include descendants true' | '&include-descendants=true' || INCLUDE_ALL_DESCENDANTS
+ 'include descendants TRUE' | '&include-descendants=true' || INCLUDE_ALL_DESCENDANTS
+ 'include descendants false' | '&include-descendants=false' || OMIT_DESCENDANTS
+ 'include descendants FALSE' | '&include-descendants=FALSE' || OMIT_DESCENDANTS
+ 'options (ignored)' | '&options=(a-=1)' || OMIT_DESCENDANTS
+ }
+
+ def 'Execute (async) data operation to read data from dmi service.'() {
+ given: 'data operation url'
+ def getUrl = "$ncmpBasePathV1/data?topic=my-topic-name"
+ def dataOperationRequestJsonData = jsonObjectMapper.asJsonString(getDataOperationRequest("read", datastore.datastoreName))
+ when: 'post data operation request is performed'