From e05a59a2361394d6fc4a93193b0ed35ba305fcf8 Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Fri, 23 Jun 2023 14:37:12 +0100 Subject: 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 Change-Id: I5c179882bfba71d3b009c60059e9073f46227e7d --- cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cps-ri/src/test') 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' -- cgit 1.2.3-korg