26
26
import org .junit .jupiter .api .extension .ExtendWith ;
27
27
import org .mockito .Mock ;
28
28
import org .mockito .junit .jupiter .MockitoExtension ;
29
-
30
29
import org .springframework .data .domain .PageRequest ;
31
30
import org .springframework .data .domain .Pageable ;
32
31
import org .springframework .data .keyvalue .Person ;
@@ -56,6 +55,7 @@ class KeyValuePartTreeQueryUnitTests {
56
55
void spelExpressionAndContextShouldNotBeReused () throws NoSuchMethodException , SecurityException {
57
56
58
57
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
58
+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
59
59
when (metadataMock .getReturnType (any (Method .class )))
60
60
.thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
61
61
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -79,6 +79,7 @@ void spelExpressionAndContextShouldNotBeReused() throws NoSuchMethodException, S
79
79
void shouldApplyPageableParameterToCollectionQuery () throws SecurityException , NoSuchMethodException {
80
80
81
81
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
82
+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
82
83
when (metadataMock .getReturnType (any (Method .class )))
83
84
.thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
84
85
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -100,6 +101,7 @@ void shouldApplyPageableParameterToCollectionQuery() throws SecurityException, N
100
101
void shouldApplyDerivedMaxResultsToQuery () throws SecurityException , NoSuchMethodException {
101
102
102
103
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
104
+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
103
105
when (metadataMock .getReturnType (any (Method .class )))
104
106
.thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
105
107
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -119,6 +121,7 @@ void shouldApplyDerivedMaxResultsToQuery() throws SecurityException, NoSuchMetho
119
121
void shouldApplyDerivedMaxResultsToQueryWithParameters () throws SecurityException , NoSuchMethodException {
120
122
121
123
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
124
+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
122
125
when (metadataMock .getReturnType (any (Method .class )))
123
126
.thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
124
127
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -141,6 +144,7 @@ void shouldApplyDerivedMaxResultsToQueryWithParameters() throws SecurityExceptio
141
144
void shouldUseCountForExists () throws NoSuchMethodException {
142
145
143
146
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
147
+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
144
148
when (metadataMock .getReturnType (any (Method .class )))
145
149
.thenReturn ((TypeInformation ) ClassTypeInformation .from (Boolean .class ));
146
150
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Boolean .class );
0 commit comments