3636import org .springframework .data .repository .core .RepositoryMetadata ;
3737import org .springframework .data .repository .query .QueryMethod ;
3838import org .springframework .data .repository .query .QueryMethodEvaluationContextProvider ;
39- import org .springframework .data .util .ClassTypeInformation ;
4039import org .springframework .data .util .TypeInformation ;
4140
4241/**
@@ -56,8 +55,7 @@ void spelExpressionAndContextShouldNotBeReused() throws NoSuchMethodException, S
5655
5756 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
5857 when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
59- when (metadataMock .getReturnType (any (Method .class )))
60- .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
58+ when (metadataMock .getReturnType (any (Method .class ))).thenReturn ((TypeInformation ) TypeInformation .of (List .class ));
6159 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
6260
6361 QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findByFirstname" , String .class ), metadataMock ,
@@ -80,8 +78,7 @@ void shouldApplyPageableParameterToCollectionQuery() throws SecurityException, N
8078
8179 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
8280 when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
83- when (metadataMock .getReturnType (any (Method .class )))
84- .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
81+ when (metadataMock .getReturnType (any (Method .class ))).thenReturn ((TypeInformation ) TypeInformation .of (List .class ));
8582 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
8683
8784 QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findBy" , Pageable .class ), metadataMock ,
@@ -102,8 +99,7 @@ void shouldApplyDerivedMaxResultsToQuery() throws SecurityException, NoSuchMetho
10299
103100 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
104101 when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
105- when (metadataMock .getReturnType (any (Method .class )))
106- .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
102+ when (metadataMock .getReturnType (any (Method .class ))).thenReturn ((TypeInformation ) TypeInformation .of (List .class ));
107103 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
108104
109105 QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findTop3By" ), metadataMock , projectionFactoryMock );
@@ -122,8 +118,7 @@ void shouldApplyDerivedMaxResultsToQueryWithParameters() throws SecurityExceptio
122118
123119 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
124120 when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
125- when (metadataMock .getReturnType (any (Method .class )))
126- .thenReturn ((TypeInformation ) ClassTypeInformation .from (List .class ));
121+ when (metadataMock .getReturnType (any (Method .class ))).thenReturn ((TypeInformation ) TypeInformation .of (List .class ));
127122 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
128123
129124 QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findTop3ByFirstname" , String .class ), metadataMock ,
@@ -145,8 +140,7 @@ void shouldUseCountForExists() throws NoSuchMethodException {
145140
146141 when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
147142 when (metadataMock .getDomainTypeInformation ()).thenReturn ((TypeInformation ) TypeInformation .of (Person .class ));
148- when (metadataMock .getReturnType (any (Method .class )))
149- .thenReturn ((TypeInformation ) ClassTypeInformation .from (Boolean .class ));
143+ when (metadataMock .getReturnType (any (Method .class ))).thenReturn ((TypeInformation ) TypeInformation .of (Boolean .class ));
150144 when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Boolean .class );
151145
152146 QueryMethod qm = new QueryMethod (Repo .class .getMethod ("existsByFirstname" , String .class ), metadataMock ,
0 commit comments