2626import org .junit .jupiter .api .extension .ExtendWith ;
2727import org .mockito .Mock ;
2828import org .mockito .junit .jupiter .MockitoExtension ;
29-
3029import org .springframework .data .domain .PageRequest ;
3130import org .springframework .data .domain .Pageable ;
3231import org .springframework .data .keyvalue .Person ;
@@ -56,6 +55,7 @@ class KeyValuePartTreeQueryUnitTests {
5655 void spelExpressionAndContextShouldNotBeReused () throws NoSuchMethodException , SecurityException {
5756
5857 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
58+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
5959 when (metadataMock .getReturnType (any (Method .class )))
6060 .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
6161 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -79,6 +79,7 @@ void spelExpressionAndContextShouldNotBeReused() throws NoSuchMethodException, S
7979 void shouldApplyPageableParameterToCollectionQuery () throws SecurityException , NoSuchMethodException {
8080
8181 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
82+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
8283 when (metadataMock .getReturnType (any (Method .class )))
8384 .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
8485 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -100,6 +101,7 @@ void shouldApplyPageableParameterToCollectionQuery() throws SecurityException, N
100101 void shouldApplyDerivedMaxResultsToQuery () throws SecurityException , NoSuchMethodException {
101102
102103 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
104+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
103105 when (metadataMock .getReturnType (any (Method .class )))
104106 .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
105107 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -119,6 +121,7 @@ void shouldApplyDerivedMaxResultsToQuery() throws SecurityException, NoSuchMetho
119121 void shouldApplyDerivedMaxResultsToQueryWithParameters () throws SecurityException , NoSuchMethodException {
120122
121123 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
124+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
122125 when (metadataMock .getReturnType (any (Method .class )))
123126 .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
124127 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
@@ -141,6 +144,7 @@ void shouldApplyDerivedMaxResultsToQueryWithParameters() throws SecurityExceptio
141144 void shouldUseCountForExists () throws NoSuchMethodException {
142145
143146 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
147+ when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
144148 when (metadataMock .getReturnType (any (Method .class )))
145149 .thenReturn ((TypeInformation ) ClassTypeInformation .from (Boolean .class ));
146150 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Boolean .class );
0 commit comments