summaryrefslogtreecommitdiffstats
path: root/cps-ri/src
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2023-04-11 14:36:31 +0100
committerdanielhanrahan <daniel.hanrahan@est.tech>2023-04-12 16:46:24 +0100
commit4760869cc48115b79830dee10c20d4466110d716 (patch)
tree617cf12dae5c83d1b204dc8a0abad68132fb4a96 /cps-ri/src
parentfabc72d633468d2f94346896bc8b09687248731e (diff)
Migrate query tests to integration-test module #5
- Migrate query tests for composite keys to integration-test - Add addresses with composite key to bookstore model Issue-ID: CPS-1597 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I6f8dfc2c44ae6ba3bac1cce804841671ef5a009d
Diffstat (limited to 'cps-ri/src')
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy17
1 files changed, 0 insertions, 17 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy
index d5a6be4e8..f025206c3 100644
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy
@@ -38,23 +38,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase {
static final String SET_DATA = '/data/cps-path-query.sql'
@Sql([CLEAR_DATA, SET_DATA])
- def 'Cps Path query using descendant anywhere with #scenario condition(s) for a list element.'() {
- when: 'a query is executed to get a data node by the given cps path'
- def result = objectUnderTest.queryDataNodes(DATASPACE_NAME, ANCHOR_FOR_SHOP_EXAMPLE, cpsPath, OMIT_DESCENDANTS)
- then: 'the correct number of data nodes are retrieved'
- result.size() == expectedXPaths.size()
- and: 'xpaths of the retrieved data nodes are as expected'
- for (int i = 0; i < result.size(); i++) {
- assert result[i].getXpath() == expectedXPaths[i]
- }
- where: 'the following data is used'
- scenario | cpsPath || expectedXPaths
- 'one partial key leaf' | '//author[@FirstName="Joe"]' || ["/shops/shop[@id='1']/categories[@code='1']/book/author[@FirstName='Joe' and @Surname='Bloggs']", "/shops/shop[@id='1']/categories[@code='2']/book/author[@FirstName='Joe' and @Surname='Smith']"]
- 'one non key leaf' | '//author[@title="Dune"]' || ["/shops/shop[@id='1']/categories[@code='1']/book/author[@FirstName='Joe' and @Surname='Bloggs']"]
- 'mix of partial key and non key leaf' | '//author[@FirstName="Joe" and @title="Dune"]' || ["/shops/shop[@id='1']/categories[@code='1']/book/author[@FirstName='Joe' and @Surname='Bloggs']"]
- }
-
- @Sql([CLEAR_DATA, SET_DATA])
def 'Cps Path query across anchors for leaf value(s) with : #scenario.'() {
when: 'a query is executed to get a data node by the given cps path'
def result = objectUnderTest.queryDataNodesAcrossAnchors(DATASPACE_NAME, cpsPath, includeDescendantsOption)