File tree 2 files changed +12
-3
lines changed
src/test/java/org/springframework/data/couchbase/repository/query
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 26
26
<jodatime >2.10.13</jodatime >
27
27
<jackson-joda >2.13.4</jackson-joda >
28
28
<jakarta .el>4.0.0</jakarta .el>
29
+ <querydsl_of >6.11</querydsl_of >
29
30
</properties >
30
31
31
32
<dependencyManagement >
43
44
<dependencies >
44
45
45
46
<dependency >
46
- <groupId >com .querydsl</groupId >
47
+ <groupId >io.github.openfeign .querydsl</groupId >
47
48
<artifactId >querydsl-apt</artifactId >
48
- <version >${querydsl} </version >
49
- <classifier >jakarta</classifier >
49
+ <version >${querydsl_of} </version >
50
50
<scope >provided</scope >
51
51
</dependency >
52
52
Original file line number Diff line number Diff line change 20
20
import static org .junit .jupiter .api .Assertions .assertArrayEquals ;
21
21
import static org .junit .jupiter .api .Assertions .assertEquals ;
22
22
import static org .junit .jupiter .api .Assertions .assertNull ;
23
+ import static org .junit .jupiter .api .Assertions .assertThrows ;
23
24
import static org .springframework .data .couchbase .util .Util .comprises ;
24
25
import static org .springframework .data .couchbase .util .Util .exactly ;
25
26
29
30
import java .util .Optional ;
30
31
import java .util .stream .StreamSupport ;
31
32
33
+ import com .querydsl .core .types .dsl .PathBuilder ;
32
34
import org .junit .jupiter .api .AfterAll ;
33
35
import org .junit .jupiter .api .BeforeAll ;
34
36
import org .junit .jupiter .api .BeforeEach ;
@@ -147,6 +149,13 @@ void testEq() {
147
149
}
148
150
}
149
151
152
+ @ Test
153
+ void testInjection () {
154
+ String userSpecifiedPath = "1 = 1) OR (2" ;
155
+ PathBuilder <QAirline > pathBuilder = new PathBuilder <>(QAirline .class , "xyz" );
156
+ assertThrows (IllegalStateException .class , () -> pathBuilder .get (userSpecifiedPath ).eq ("2" ));
157
+ }
158
+
150
159
// this gives hqCountry == "" and hqCountry is missing
151
160
// @Test
152
161
void testStringIsEmpty () {
You can’t perform that action at this time.
0 commit comments