39
39
40
40
import org .junit .jupiter .api .BeforeEach ;
41
41
import org .junit .jupiter .api .Test ;
42
+ import org .junit .jupiter .api .condition .DisabledOnJre ;
43
+ import org .junit .jupiter .api .condition .JRE ;
42
44
import org .junit .jupiter .api .extension .ExtendWith ;
43
45
import org .mockito .ArgumentMatchers ;
44
46
import org .mockito .Mock ;
45
47
import org .mockito .junit .jupiter .MockitoExtension ;
46
48
import org .mockito .junit .jupiter .MockitoSettings ;
47
49
import org .mockito .quality .Strictness ;
48
-
49
50
import org .springframework .data .domain .Example ;
50
51
import org .springframework .data .domain .ExampleMatcher ;
51
52
import org .springframework .data .domain .ExampleMatcher .GenericPropertyMatcher ;
@@ -90,19 +91,16 @@ class QueryByExamplePredicateBuilderUnitTests {
90
91
void setUp () {
91
92
92
93
personIdAttribute = new SingularAttributeStub <>("id" , PersistentAttributeType .BASIC , Long .class );
93
- personFirstnameAttribute = new SingularAttributeStub <>("firstname" , PersistentAttributeType .BASIC ,
94
- String .class );
94
+ personFirstnameAttribute = new SingularAttributeStub <>("firstname" , PersistentAttributeType .BASIC , String .class );
95
95
personAgeAttribute = new SingularAttributeStub <>("age" , PersistentAttributeType .BASIC , Long .class );
96
- personFatherAttribute = new SingularAttributeStub <>("father" , PersistentAttributeType .MANY_TO_ONE ,
97
- Person .class , personEntityType );
98
- personSkillAttribute = new SingularAttributeStub <>("skill" , PersistentAttributeType .EMBEDDED ,
99
- Skill .class , skillEntityType );
100
- personAddressAttribute = new SingularAttributeStub <>("address" , PersistentAttributeType .EMBEDDED ,
101
- Address .class );
102
- skillNameAttribute = new SingularAttributeStub <>("name" , PersistentAttributeType .BASIC ,
103
- String .class );
104
- skillNestedAttribute = new SingularAttributeStub <>("nested" , PersistentAttributeType .MANY_TO_ONE ,
105
- Skill .class , skillEntityType );
96
+ personFatherAttribute = new SingularAttributeStub <>("father" , PersistentAttributeType .MANY_TO_ONE , Person .class ,
97
+ personEntityType );
98
+ personSkillAttribute = new SingularAttributeStub <>("skill" , PersistentAttributeType .EMBEDDED , Skill .class ,
99
+ skillEntityType );
100
+ personAddressAttribute = new SingularAttributeStub <>("address" , PersistentAttributeType .EMBEDDED , Address .class );
101
+ skillNameAttribute = new SingularAttributeStub <>("name" , PersistentAttributeType .BASIC , String .class );
102
+ skillNestedAttribute = new SingularAttributeStub <>("nested" , PersistentAttributeType .MANY_TO_ONE , Skill .class ,
103
+ skillEntityType );
106
104
107
105
personEntityAttribtues = new LinkedHashSet <>();
108
106
personEntityAttribtues .add (personIdAttribute );
@@ -169,6 +167,7 @@ void singleElementCriteriaShouldJustReturnIt() {
169
167
verify (cb , times (1 )).equal (any (Expression .class ), eq ("foo" ));
170
168
}
171
169
170
+ @ DisabledOnJre ({ JRE .JAVA_11 , JRE .JAVA_17 })
172
171
@ Test // DATAJPA-218
173
172
void multiPredicateCriteriaShouldReturnCombinedOnes () {
174
173
@@ -183,6 +182,7 @@ void multiPredicateCriteriaShouldReturnCombinedOnes() {
183
182
verify (cb , times (1 )).equal (any (Expression .class ), eq (2L ));
184
183
}
185
184
185
+ @ DisabledOnJre ({ JRE .JAVA_11 , JRE .JAVA_17 })
186
186
@ Test // DATAJPA-879
187
187
void orConcatenatesPredicatesIfMatcherSpecifies () {
188
188
@@ -306,13 +306,13 @@ static class SingularAttributeStub<X, T> implements SingularAttribute<X, T> {
306
306
private Class <T > javaType ;
307
307
private Type <T > type ;
308
308
309
- SingularAttributeStub (String name ,
310
- javax . persistence . metamodel . Attribute . PersistentAttributeType attributeType , Class <T > javaType ) {
309
+ SingularAttributeStub (String name , javax . persistence . metamodel . Attribute . PersistentAttributeType attributeType ,
310
+ Class <T > javaType ) {
311
311
this (name , attributeType , javaType , null );
312
312
}
313
313
314
- SingularAttributeStub (String name ,
315
- javax . persistence . metamodel . Attribute . PersistentAttributeType attributeType , Class <T > javaType , Type <T > type ) {
314
+ SingularAttributeStub (String name , javax . persistence . metamodel . Attribute . PersistentAttributeType attributeType ,
315
+ Class <T > javaType , Type <T > type ) {
316
316
this .name = name ;
317
317
this .attributeType = attributeType ;
318
318
this .javaType = javaType ;
0 commit comments