Skip to content

Commit 00034da

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

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

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

@@ -449,18 +481,13 @@ AND INDEX(w) = 0
449481
* @see #functionInvocationExampleWithCorrection()
450482
*/
451483
@Test
452-
@Disabled(SPEC_FAULT + "FUNCTION calls needs a comparator")
453-
void functionInvocationExample_SPEC_BUG() {
484+
void functionInvocationExample() {
454485

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

465492
assertQuery("""
466493
SELECT c

0 commit comments

Comments
 (0)