File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
spring-data-jpa/src/test/java/org/springframework/data/jpa/repository/query Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 2222import org .antlr .v4 .runtime .CommonTokenStream ;
2323import org .junit .jupiter .api .Disabled ;
2424import org .junit .jupiter .api .Test ;
25+ import org .junit .jupiter .params .ParameterizedTest ;
26+ import org .junit .jupiter .params .provider .ValueSource ;
2527
2628/**
2729 * Tests built around examples of HQL found in
@@ -1634,8 +1636,17 @@ group by extract(epoch from departureTime)
16341636 """ );
16351637 }
16361638
1637- @ Test
1638- void queryWithSignedNumericLiteralShouldWork () {
1639- assertQuery ("select -1" );
1639+ @ ParameterizedTest // GH-3342
1640+ @ ValueSource (strings = {
1641+ "select 1 from User" ,
1642+ "select -1 from User" ,
1643+ "select +1 from User" ,
1644+ "select +1*-100 from User" ,
1645+ "select count(u)*-0.7f from User u" ,
1646+ "select count(oi) + (-100) as perc from StockOrderItem oi" ,
1647+ "select p from Payment p where length(p.cardNumber) between +16 and -20"
1648+ })
1649+ void signedLiteralShouldWork (String query ) {
1650+ assertQuery (query );
16401651 }
16411652}
You can’t perform that action at this time.
0 commit comments