diff options
author | danielhanrahan <daniel.hanrahan@est.tech> | 2023-06-23 14:37:12 +0100 |
---|---|---|
committer | danielhanrahan <daniel.hanrahan@est.tech> | 2023-07-10 12:20:30 +0100 |
commit | e05a59a2361394d6fc4a93193b0ed35ba305fcf8 (patch) | |
tree | cc5a48a39bdee3a66bb82161a9d4a6e8b5868a99 /cps-ri/src/test/groovy/org/onap | |
parent | 5769fae8b2cf4246bb2fd079dfd7b8db8130fcc0 (diff) |
Handle special characters in CpsPath queries (CPS-1760 #2)
This fixes issues with special characters for CPS-500, CPS-1756,
CPS-1758, and CPS-1760. It also improves query performance.
- use SQL LIKE instead of regex in Cps Path queries
Issue-ID: CPS-1763
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I5c179882bfba71d3b009c60059e9073f46227e7d
Diffstat (limited to 'cps-ri/src/test/groovy/org/onap')
-rw-r--r-- | cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy index 17eb8846a1..7de9b97ba0 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy @@ -25,8 +25,8 @@ import spock.lang.Specification class EscapeUtilsSpec extends Specification { def 'Escape text for using in SQL LIKE operation'() { - expect: - EscapeUtils.escapeForSqlLike(unescapedText) == escapedText + expect: 'SQL LIKE special characters to be escaped with forward-slash' + assert EscapeUtils.escapeForSqlLike(unescapedText) == escapedText where: unescapedText || escapedText 'Only %, _, and \\ are special' || 'Only \\%, \\_, and \\\\ are special' |