use of org.springframework.security.oauth2.core.OAuth2TokenFormat in project spring-authorization-server by spring-projects.
the class JwtGeneratorTests method generateWhenUnsupportedTokenFormatThenReturnNull.
@Test
public void generateWhenUnsupportedTokenFormatThenReturnNull() {
// @formatter:off
TokenSettings tokenSettings = TokenSettings.builder().accessTokenFormat(new OAuth2TokenFormat("unsupported_token_format")).build();
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().tokenSettings(tokenSettings).build();
OAuth2TokenContext tokenContext = DefaultOAuth2TokenContext.builder().registeredClient(registeredClient).tokenType(OAuth2TokenType.ACCESS_TOKEN).build();
// @formatter:on
assertThat(this.jwtGenerator.generate(tokenContext)).isNull();
}
use of org.springframework.security.oauth2.core.OAuth2TokenFormat in project spring-authorization-server by spring-projects.
the class OAuth2AccessTokenGeneratorTests method generateWhenUnsupportedTokenFormatThenReturnNull.
@Test
public void generateWhenUnsupportedTokenFormatThenReturnNull() {
// @formatter:off
TokenSettings tokenSettings = TokenSettings.builder().accessTokenFormat(new OAuth2TokenFormat("unsupported_token_format")).build();
RegisteredClient registeredClient = TestRegisteredClients.registeredClient().tokenSettings(tokenSettings).build();
OAuth2TokenContext tokenContext = DefaultOAuth2TokenContext.builder().registeredClient(registeredClient).tokenType(OAuth2TokenType.ACCESS_TOKEN).build();
// @formatter:on
assertThat(this.accessTokenGenerator.generate(tokenContext)).isNull();
}
Aggregations