Skip to content

Commit 7804874

Browse files
committed
Merge (Hql|Jpql|Eql)SpecificationTests with their corresponding QueryRendererTests.
Closes #3692
1 parent 4d1f401 commit 7804874

8 files changed

+994
-4316
lines changed

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

+33-6
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,38 @@ OR TREAT(e AS Contractor).hours > 100
343343
""");
344344
}
345345

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

@@ -454,18 +486,13 @@ AND INDEX(w) = 0
454486
* @see #functionInvocationExampleWithCorrection()
455487
*/
456488
@Test
457-
@Disabled(SPEC_FAULT + "FUNCTION calls needs a comparator")
458-
void functionInvocationExample_SPEC_BUG() {
489+
void functionInvocationExample() {
459490

460491
assertQuery("""
461492
SELECT c
462493
FROM Customer c
463494
WHERE FUNCTION('hasGoodCredit', c.balance, c.creditLimit)
464495
""");
465-
}
466-
467-
@Test
468-
void functionInvocationExampleWithCorrection() {
469496

470497
assertQuery("""
471498
SELECT c

0 commit comments

Comments
 (0)