diff options
Diffstat (limited to 'integration-test/src/test/groovy/org/onap')
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy index 42fb964d52..6ae14dd11b 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy @@ -458,8 +458,8 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase { assert result.anchorName.toSet() == [BOOKSTORE_ANCHOR_1, BOOKSTORE_ANCHOR_2].toSet() } - def 'Query with a limit of #limit.' () { - when: + def 'Query data nodes with a limit of #limit.' () { + when: 'a query for data nodes is executed with a result limit' def result = objectUnderTest.queryDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/bookstore/categories', OMIT_DESCENDANTS, limit) then: 'the expected number of nodes is returned' assert countDataNodesInTree(result) == expectedNumberOfResults @@ -470,4 +470,17 @@ class QueryServiceIntegrationSpec extends FunctionalSpecBase { 0 || 5 -1 || 5 } + + def 'Query data leaf with a limit of #limit.' () { + when: 'a query for data leaf is executed with a result limit' + def result = objectUnderTest.queryDataLeaf(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, '/bookstore/categories/@name', limit, String) + then: 'the expected number of leaf values is returned' + assert result.size() == expectedNumberOfResults + where: 'the following parameters are used' + limit || expectedNumberOfResults + 1 || 1 + 2 || 2 + 0 || 5 + -1 || 5 + } } |