use of org.springframework.security.oauth2.client.endpoint.DefaultPasswordTokenResponseClient in project spring-security by spring-projects.
the class OAuth2AuthorizedClientProviderBuilderTests method setup.
@SuppressWarnings("unchecked")
@BeforeEach
public void setup() {
OAuth2AccessTokenResponse accessTokenResponse = TestOAuth2AccessTokenResponses.accessTokenResponse().build();
this.accessTokenClient = mock(RestOperations.class);
given(this.accessTokenClient.exchange(any(RequestEntity.class), eq(OAuth2AccessTokenResponse.class))).willReturn(new ResponseEntity(accessTokenResponse, HttpStatus.OK));
this.refreshTokenTokenResponseClient = new DefaultRefreshTokenTokenResponseClient();
this.refreshTokenTokenResponseClient.setRestOperations(this.accessTokenClient);
this.clientCredentialsTokenResponseClient = new DefaultClientCredentialsTokenResponseClient();
this.clientCredentialsTokenResponseClient.setRestOperations(this.accessTokenClient);
this.passwordTokenResponseClient = new DefaultPasswordTokenResponseClient();
this.passwordTokenResponseClient.setRestOperations(this.accessTokenClient);
this.principal = new TestingAuthenticationToken("principal", "password");
}
Aggregations