@@ -89,7 +89,7 @@ public class ServerOAuth2AuthorizedClientExchangeFilterFunctionTests {
89
89
private ReactiveClientRegistrationRepository clientRegistrationRepository ;
90
90
91
91
@ Mock
92
- private OAuth2AuthorizedClientResolver oAuth2AuthorizedClientResolver ;
92
+ private OAuth2AuthorizedClientResolver authorizedClientResolver ;
93
93
94
94
@ Mock
95
95
private ServerWebExchange serverWebExchange ;
@@ -155,7 +155,7 @@ public void filterWhenClientCredentialsTokenExpiredThenGetNewToken() {
155
155
ClientRegistration registration = TestClientRegistrations .clientCredentials ().build ();
156
156
String clientRegistrationId = registration .getClientId ();
157
157
158
- this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientRepository , this .oAuth2AuthorizedClientResolver );
158
+ this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientRepository , this .authorizedClientResolver );
159
159
160
160
OAuth2AccessToken newAccessToken = new OAuth2AccessToken (OAuth2AccessToken .TokenType .BEARER ,
161
161
"new-token" ,
@@ -164,8 +164,8 @@ public void filterWhenClientCredentialsTokenExpiredThenGetNewToken() {
164
164
OAuth2AuthorizedClient newAuthorizedClient = new OAuth2AuthorizedClient (registration ,
165
165
"principalName" , newAccessToken , null );
166
166
Request r = new Request (clientRegistrationId , authentication , null );
167
- when (this .oAuth2AuthorizedClientResolver .clientCredentials (any (), any (), any ())).thenReturn (Mono .just (newAuthorizedClient ));
168
- when (this .oAuth2AuthorizedClientResolver .createDefaultedRequest (any (), any (), any ())).thenReturn (Mono .just (r ));
167
+ when (this .authorizedClientResolver .clientCredentials (any (), any (), any ())).thenReturn (Mono .just (newAuthorizedClient ));
168
+ when (this .authorizedClientResolver .createDefaultedRequest (any (), any (), any ())).thenReturn (Mono .just (r ));
169
169
170
170
when (this .authorizedClientRepository .saveAuthorizedClient (any (), any (), any ())).thenReturn (Mono .empty ());
171
171
@@ -190,8 +190,8 @@ public void filterWhenClientCredentialsTokenExpiredThenGetNewToken() {
190
190
.block ();
191
191
192
192
verify (this .authorizedClientRepository ).saveAuthorizedClient (any (), eq (authentication ), any ());
193
- verify (this .oAuth2AuthorizedClientResolver ).clientCredentials (any (), any (), any ());
194
- verify (this .oAuth2AuthorizedClientResolver ).createDefaultedRequest (any (), any (), any ());
193
+ verify (this .authorizedClientResolver ).clientCredentials (any (), any (), any ());
194
+ verify (this .authorizedClientResolver ).createDefaultedRequest (any (), any (), any ());
195
195
196
196
List <ClientRequest > requests = this .exchange .getRequests ();
197
197
assertThat (requests ).hasSize (1 );
@@ -207,7 +207,7 @@ public void filterWhenClientCredentialsTokenNotExpiredThenUseCurrentToken() {
207
207
TestingAuthenticationToken authentication = new TestingAuthenticationToken ("test" , "this" );
208
208
ClientRegistration registration = TestClientRegistrations .clientCredentials ().build ();
209
209
210
- this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientRepository , this .oAuth2AuthorizedClientResolver );
210
+ this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientRepository , this .authorizedClientResolver );
211
211
212
212
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient (registration ,
213
213
"principalName" , this .accessToken , null );
@@ -219,8 +219,8 @@ public void filterWhenClientCredentialsTokenNotExpiredThenUseCurrentToken() {
219
219
.subscriberContext (ReactiveSecurityContextHolder .withAuthentication (authentication ))
220
220
.block ();
221
221
222
- verify (this .oAuth2AuthorizedClientResolver , never ()).clientCredentials (any (), any (), any ());
223
- verify (this .oAuth2AuthorizedClientResolver , never ()).createDefaultedRequest (any (), any (), any ());
222
+ verify (this .authorizedClientResolver , never ()).clientCredentials (any (), any (), any ());
223
+ verify (this .authorizedClientResolver , never ()).createDefaultedRequest (any (), any (), any ());
224
224
225
225
List <ClientRequest > requests = this .exchange .getRequests ();
226
226
assertThat (requests ).hasSize (1 );
0 commit comments