62
62
import static org .mockito .Mockito .verify ;
63
63
import static org .mockito .Mockito .when ;
64
64
import static org .springframework .http .HttpMethod .GET ;
65
- import static org .springframework .security .oauth2 .client .web .reactive .function .client .OAuth2AuthorizedClientExchangeFilterFunction .oauth2AuthorizedClient ;
65
+ import static org .springframework .security .oauth2 .client .web .reactive .function .client .ServerOAuth2AuthorizedClientExchangeFilterFunction .oauth2AuthorizedClient ;
66
66
67
67
/**
68
68
* @author Rob Winch
69
69
* @since 5.1
70
70
*/
71
71
@ RunWith (MockitoJUnitRunner .class )
72
- public class OAuth2AuthorizedClientExchangeFilterFunctionTests {
72
+ public class ServerOAuth2AuthorizedClientExchangeFilterFunctionTests {
73
73
@ Mock
74
74
private ReactiveOAuth2AuthorizedClientService authorizedClientService ;
75
75
76
- private OAuth2AuthorizedClientExchangeFilterFunction function = new OAuth2AuthorizedClientExchangeFilterFunction ();
76
+ private ServerOAuth2AuthorizedClientExchangeFilterFunction function = new ServerOAuth2AuthorizedClientExchangeFilterFunction ();
77
77
78
78
private MockExchangeFunction exchange = new MockExchangeFunction ();
79
79
@@ -151,7 +151,7 @@ public void filterWhenRefreshRequiredThenRefresh() {
151
151
this .accessToken .getTokenValue (),
152
152
issuedAt ,
153
153
accessTokenExpiresAt );
154
- this .function = new OAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
154
+ this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
155
155
156
156
OAuth2RefreshToken refreshToken = new OAuth2RefreshToken ("refresh-token" , issuedAt , refreshTokenExpiresAt );
157
157
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient (this .github ,
@@ -200,7 +200,7 @@ public void filterWhenRefreshRequiredAndEmptyReactiveSecurityContextThenSaved()
200
200
this .accessToken .getTokenValue (),
201
201
issuedAt ,
202
202
accessTokenExpiresAt );
203
- this .function = new OAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
203
+ this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
204
204
205
205
OAuth2RefreshToken refreshToken = new OAuth2RefreshToken ("refresh-token" , issuedAt , refreshTokenExpiresAt );
206
206
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient (this .github ,
@@ -232,7 +232,7 @@ public void filterWhenRefreshRequiredAndEmptyReactiveSecurityContextThenSaved()
232
232
233
233
@ Test
234
234
public void filterWhenRefreshTokenNullThenShouldRefreshFalse () {
235
- this .function = new OAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
235
+ this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
236
236
237
237
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient (this .github ,
238
238
"principalName" , this .accessToken );
@@ -254,7 +254,7 @@ public void filterWhenRefreshTokenNullThenShouldRefreshFalse() {
254
254
255
255
@ Test
256
256
public void filterWhenNotExpiredThenShouldRefreshFalse () {
257
- this .function = new OAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
257
+ this .function = new ServerOAuth2AuthorizedClientExchangeFilterFunction (this .authorizedClientService );
258
258
259
259
OAuth2RefreshToken refreshToken = new OAuth2RefreshToken ("refresh-token" , this .accessToken .getIssuedAt (), this .accessToken .getExpiresAt ());
260
260
OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient (this .github ,
0 commit comments