diff options
author | Toine Siebelink <toine.siebelink@est.tech> | 2023-07-10 09:06:56 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2023-07-10 09:06:56 +0000 |
commit | 4f1edfa89cdf024b032080fe3be5a9634a8ab09d (patch) | |
tree | 69a0d43e928952b9d2af512341d9ba5c36da73da /integration-test | |
parent | 6ffb18b25972de507b029ff1b4470682651726b8 (diff) | |
parent | 531bd1002a480728936f8fa29ce87d4418783878 (diff) |
Merge "Escape SQL LIKE wildcards in queries (CPS-1760 #1)"
Diffstat (limited to 'integration-test')
-rw-r--r-- | integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy | 11 |
1 files changed, 11 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 fa0b820459..0cb3200f80 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 @@ -339,4 +339,15 @@ class CpsQueryServiceIntegrationSpec extends FunctionalSpecBase { 'incomplete absolute 1 list entry' | '/categories[@code="3"]' || 0 } + def 'Cps Path query should ignore special characters: #scenario.'() { + when: 'a query is executed to get data nodes by the given cps path' + def result = objectUnderTest.queryDataNodes(FUNCTIONAL_TEST_DATASPACE_1, BOOKSTORE_ANCHOR_1, cpsPath, INCLUDE_ALL_DESCENDANTS) + then: 'no data nodes are returned' + assert result.isEmpty() + where: + scenario | cpsPath + ' sql wildcard in contains-condition' | '/bookstore/categories[@code="1"]/books[contains(@title, "%")]' + 'regex wildcard in contains-condition' | '/bookstore/categories[@code="1"]/books[contains(@title, ".*")]' + } + } |