36
36
import org .springframework .data .repository .core .RepositoryMetadata ;
37
37
import org .springframework .data .repository .query .QueryMethod ;
38
38
import org .springframework .data .repository .query .QueryMethodEvaluationContextProvider ;
39
- import org .springframework .data .util .ClassTypeInformation ;
40
39
import org .springframework .data .util .TypeInformation ;
41
40
42
41
/**
@@ -56,8 +55,7 @@ void spelExpressionAndContextShouldNotBeReused() throws NoSuchMethodException, S
56
55
57
56
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
58
57
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 ));
61
59
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
62
60
63
61
QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findByFirstname" , String .class ), metadataMock ,
@@ -80,8 +78,7 @@ void shouldApplyPageableParameterToCollectionQuery() throws SecurityException, N
80
78
81
79
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
82
80
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 ));
85
82
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
86
83
87
84
QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findBy" , Pageable .class ), metadataMock ,
@@ -102,8 +99,7 @@ void shouldApplyDerivedMaxResultsToQuery() throws SecurityException, NoSuchMetho
102
99
103
100
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
104
101
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 ));
107
103
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
108
104
109
105
QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findTop3By" ), metadataMock , projectionFactoryMock );
@@ -122,8 +118,7 @@ void shouldApplyDerivedMaxResultsToQueryWithParameters() throws SecurityExceptio
122
118
123
119
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
124
120
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 ));
127
122
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Person .class );
128
123
129
124
QueryMethod qm = new QueryMethod (Repo .class .getMethod ("findTop3ByFirstname" , String .class ), metadataMock ,
@@ -145,8 +140,7 @@ void shouldUseCountForExists() throws NoSuchMethodException {
145
140
146
141
when (metadataMock .getDomainType ()).thenReturn ((Class ) Person .class );
147
142
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 ));
150
144
when (metadataMock .getReturnedDomainClass (any (Method .class ))).thenReturn ((Class ) Boolean .class );
151
145
152
146
QueryMethod qm = new QueryMethod (Repo .class .getMethod ("existsByFirstname" , String .class ), metadataMock ,
0 commit comments