summaryrefslogtreecommitdiffstats
path: root/integration-test
diff options
context:
space:
mode:
Diffstat (limited to 'integration-test')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy17
1 files changed, 17 insertions, 0 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy
index b723d7d99a..4e596da14d 100644
--- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy
+++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy
@@ -298,4 +298,21 @@ class CpsQueryServiceIntegrationSpec extends FunctionalSpecBase {
thrown(CpsPathException)
}
+ def 'Cps Path querys with all descendants including descendants that are list entries: #scenario.'() {
+ when: 'a query is executed to get a data node by the given cps path'
+ def result = objectUnderTest.queryDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, cpsPath, INCLUDE_ALL_DESCENDANTS)
+ then: 'correct number of datanodes are returned'
+ assert countDataNodesInTree(result) == expectedNumberOfDataNodes
+ where:
+ scenario | cpsPath || expectedNumberOfDataNodes
+ 'absolute path all list entries' | '/bookstore/categories' || 13
+ 'absolute path 1 list entry by key' | '/bookstore/categories[@code="3"]' || 5
+ 'absolute path 1 list entry by name' | '/bookstore/categories[@name="Comedy"]' || 5
+ 'relative path all list entries' | '//categories' || 13
+ 'relative path 1 list entry by key' | '//categories[@code="3"]' || 5
+ 'relative path 1 list entry by leaf' | '//categories[@name="Comedy"]' || 5
+ 'incomplete absolute path' | '/categories' || 0
+ 'incomplete absolute 1 list entry' | '/categories[@code="3"]' || 0
+ }
+
}