Skip to content

Commit d2abc61

Browse files
committed
Merge (Hql|Jpql|Eql)SpecificationTests with their corresponding QueryRendererTests.
Closes #3692
1 parent 19571e4 commit d2abc61

File tree

8 files changed

+996
-4289
lines changed

8 files changed

+996
-4289
lines changed

spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query/EqlQueryRendererTests.java

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,6 +347,38 @@ select cast(i as string) from Item i where cast(i.date as date) <= cast(:current
347347
assertQuery("SELECT e FROM Employee e WHERE CAST(e.salary NUMERIC(10, 2)) > 0.0");
348348
}
349349

350+
@Test // GH-3136
351+
void substring() {
352+
353+
assertQuery("select substring(c.number, 1, 2) " + //
354+
"from Call c");
355+
356+
assertQuery("select substring(c.number, 1) " + //
357+
"from Call c");
358+
}
359+
360+
@Test // GH-3136
361+
void currentDateFunctions() {
362+
363+
assertQuery("select CURRENT_DATE " + //
364+
"from Call c ");
365+
366+
assertQuery("select CURRENT_TIME " + //
367+
"from Call c ");
368+
369+
assertQuery("select CURRENT_TIMESTAMP " + //
370+
"from Call c ");
371+
372+
assertQuery("select LOCAL_DATE " + //
373+
"from Call c ");
374+
375+
assertQuery("select LOCAL_TIME " + //
376+
"from Call c ");
377+
378+
assertQuery("select LOCAL_DATETIME " + //
379+
"from Call c ");
380+
}
381+
350382
@Test
351383
void pathExpressionsNamedParametersExample() {
352384

@@ -458,18 +490,13 @@ AND INDEX(w) = 0
458490
* @see #functionInvocationExampleWithCorrection()
459491
*/
460492
@Test
461-
@Disabled(SPEC_FAULT + "FUNCTION calls needs a comparator")
462-
void functionInvocationExample_SPEC_BUG() {
493+
void functionInvocationExample() {
463494

464495
assertQuery("""
465496
SELECT c
466497
FROM Customer c
467498
WHERE FUNCTION('hasGoodCredit', c.balance, c.creditLimit)
468499
""");
469-
}
470-
471-
@Test
472-
void functionInvocationExampleWithCorrection() {
473500

474501
assertQuery("""
475502
SELECT c

0 commit comments

Comments
 (0)