@ -1395,10 +1395,9 @@ public class OAuth2ResourceServerConfigurerTests {
context . registerBean ( "converterOne" , JwtAuthenticationConverter . class , ( ) - > converterBean ) ;
context . registerBean ( "converterOne" , JwtAuthenticationConverter . class , ( ) - > converterBean ) ;
context . registerBean ( "converterTwo" , JwtAuthenticationConverter . class , ( ) - > converterBean ) ;
context . registerBean ( "converterTwo" , JwtAuthenticationConverter . class , ( ) - > converterBean ) ;
this . spring . context ( context ) . autowire ( ) ;
this . spring . context ( context ) . autowire ( ) ;
new OAuth2ResourceServerConfigurer < HttpSecurity > ( context ) . jwt ( ( jwt ) - > {
new OAuth2ResourceServerConfigurer < HttpSecurity > ( context )
assertThatExceptionOfType ( NoUniqueBeanDefinitionException . class )
. jwt ( ( jwt ) - > assertThatExceptionOfType ( NoUniqueBeanDefinitionException . class )
. isThrownBy ( jwt : : getJwtAuthenticationConverter ) ;
. isThrownBy ( jwt : : getJwtAuthenticationConverter ) ) ;
} ) ;
}
}
@Test
@Test
@ -1577,8 +1576,7 @@ public class OAuth2ResourceServerConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
// @formatter:off
http
http
. authorizeRequests ( ( authorizeRequests ) - >
. authorizeRequests ( ( authorize ) - > authorize
authorizeRequests
. requestMatchers ( "/requires-read-scope" ) . access ( "hasAuthority('SCOPE_message:read')" )
. requestMatchers ( "/requires-read-scope" ) . access ( "hasAuthority('SCOPE_message:read')" )
. anyRequest ( ) . authenticated ( )
. anyRequest ( ) . authenticated ( )
)
)
@ -1630,8 +1628,7 @@ public class OAuth2ResourceServerConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
// @formatter:off
http
http
. authorizeRequests ( ( authorizeRequests ) - >
. authorizeRequests ( ( authorize ) - > authorize
authorizeRequests
. requestMatchers ( "/requires-read-scope" ) . access ( "hasAuthority('SCOPE_message:read')" )
. requestMatchers ( "/requires-read-scope" ) . access ( "hasAuthority('SCOPE_message:read')" )
. anyRequest ( ) . authenticated ( )
. anyRequest ( ) . authenticated ( )
)
)
@ -2122,8 +2119,7 @@ public class OAuth2ResourceServerConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
// @formatter:off
http
http
. authorizeRequests ( ( authorizeRequests ) - >
. authorizeRequests ( ( authorize ) - > authorize
authorizeRequests
. anyRequest ( ) . authenticated ( )
. anyRequest ( ) . authenticated ( )
)
)
. oauth2ResourceServer ( ( oauth2ResourceServer ) - >
. oauth2ResourceServer ( ( oauth2ResourceServer ) - >
@ -2386,8 +2382,7 @@ public class OAuth2ResourceServerConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
// @formatter:off
http
http
. authorizeRequests ( ( authorizeRequests ) - >
. authorizeRequests ( ( authorize ) - > authorize
authorizeRequests
. requestMatchers ( "/requires-read-scope" ) . hasAuthority ( "SCOPE_message:read" )
. requestMatchers ( "/requires-read-scope" ) . hasAuthority ( "SCOPE_message:read" )
. anyRequest ( ) . authenticated ( )
. anyRequest ( ) . authenticated ( )
)
)
@ -2433,8 +2428,7 @@ public class OAuth2ResourceServerConfigurerTests {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
SecurityFilterChain filterChain ( HttpSecurity http ) throws Exception {
// @formatter:off
// @formatter:off
http
http
. authorizeRequests ( ( authorizeRequests ) - >
. authorizeRequests ( ( authorize ) - > authorize
authorizeRequests
. anyRequest ( ) . authenticated ( )
. anyRequest ( ) . authenticated ( )
)
)
. oauth2ResourceServer ( ( oauth2ResourceServer ) - >
. oauth2ResourceServer ( ( oauth2ResourceServer ) - >