aboutsummaryrefslogtreecommitdiffstats
path: root/integration-test
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2025-03-05 17:28:07 +0000
committerdanielhanrahan <daniel.hanrahan@est.tech>2025-03-11 09:33:56 +0000
commitb701e3090b90b4bb3aef93c9f89a6d642e6e084a (patch)
tree46c3ba9a98d6e7a45832b2514b837545190321af /integration-test
parent025b21992b7b88d03f630beb8299bf2be28286a9 (diff)
Allow limiting results in queryDataLeaf
This exposes queryResultLimit parameter in queryDataLeaf, same as was implemented for queryDataNodes API. Issue-ID: CPS-2680 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ieb922ac1acc91dbfd67fb5ade7856213a2f93ce8
Diffstat (limited to 'integration-test')
-rw-r--r--integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/QueryServiceIntegrationSpec.groovy17
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
+ }
}