Return the number of SpEL expressions created by SpelExtractor.

Closes #2885
This commit is contained in:
Mark Paluch
2023-07-20 14:06:17 +02:00
parent e3fbc9b00e
commit 9207e22632
2 changed files with 34 additions and 18 deletions

View File

@@ -65,7 +65,7 @@ class SpelQueryContextUnitTests {
assertThat(context.withEvaluationContextProvider(EVALUATION_CONTEXT_PROVIDER)).isNotNull();
}
@Test // DATACMNS-1683
@Test // DATACMNS-1683, GH-
void reportsQuotationCorrectly() {
var context = SpelQueryContext.of(PARAMETER_NAME_SOURCE, REPLACEMENT_SOURCE);
@@ -77,5 +77,6 @@ class SpelQueryContextUnitTests {
"select n from NetworkServer n where (LOWER(n.name) LIKE LOWER(NULLIF(text(concat('%',:__$synthetic$__0,'%')), '')) OR :__$synthetic$__1 IS NULL )");
assertThat(extractor.isQuoted(extractor.getQueryString().indexOf(":__$synthetic$__0"))).isFalse();
assertThat(extractor.isQuoted(extractor.getQueryString().indexOf(":__$synthetic$__1"))).isFalse();
assertThat(extractor.size()).isEqualTo(2);
}
}