Skip to content

Commit b4713d0

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

8 files changed

+996
-4289
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
@@ -337,6 +337,38 @@ OR TREAT(e AS Contractor).hours > 100
337337
""");
338338
}
339339

340+
@Test // GH-3136
341+
void substring() {
342+
343+
assertQuery("select substring(c.number, 1, 2) " + //
344+
"from Call c");
345+
346+
assertQuery("select substring(c.number, 1) " + //
347+
"from Call c");
348+
}
349+
350+
@Test // GH-3136
351+
void currentDateFunctions() {
352+
353+
assertQuery("select CURRENT_DATE " + //
354+
"from Call c ");
355+
356+
assertQuery("select CURRENT_TIME " + //
357+
"from Call c ");
358+
359+
assertQuery("select CURRENT_TIMESTAMP " + //
360+
"from Call c ");
361+
362+
assertQuery("select LOCAL_DATE " + //
363+
"from Call c ");
364+
365+
assertQuery("select LOCAL_TIME " + //
366+
"from Call c ");
367+
368+
assertQuery("select LOCAL_DATETIME " + //
369+
"from Call c ");
370+
}
371+
340372
@Test
341373
void pathExpressionsNamedParametersExample() {
342374

@@ -448,18 +480,13 @@ AND INDEX(w) = 0
448480
* @see #functionInvocationExampleWithCorrection()
449481
*/
450482
@Test
451-
@Disabled(SPEC_FAULT + "FUNCTION calls needs a comparator")
452-
void functionInvocationExample_SPEC_BUG() {
483+
void functionInvocationExample() {
453484

454485
assertQuery("""
455486
SELECT c
456487
FROM Customer c
457488
WHERE FUNCTION('hasGoodCredit', c.balance, c.creditLimit)
458489
""");
459-
}
460-
461-
@Test
462-
void functionInvocationExampleWithCorrection() {
463490

464491
assertQuery("""
465492
SELECT c

0 commit comments

Comments
 (0)