|
1 | 1 | /* |
2 | | - * Copyright 2012-2024 the original author or authors. |
| 2 | + * Copyright 2012-2025 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
|
41 | 41 | import org.springframework.security.core.userdetails.UserDetails; |
42 | 42 | import org.springframework.security.crypto.password.PasswordEncoder; |
43 | 43 | import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository; |
44 | | -import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder; |
45 | 44 | import org.springframework.security.oauth2.server.resource.introspection.ReactiveOpaqueTokenIntrospector; |
46 | 45 |
|
47 | 46 | import static org.assertj.core.api.Assertions.assertThat; |
@@ -108,14 +107,6 @@ void doesNotConfigureDefaultUserIfAuthenticationManagerResolverAvailable() { |
108 | 107 | .doesNotHaveBean(ReactiveUserDetailsService.class)); |
109 | 108 | } |
110 | 109 |
|
111 | | - @Test |
112 | | - void doesNotConfigureDefaultUserIfResourceServerWithJWTIsUsed() { |
113 | | - this.contextRunner.withUserConfiguration(JwtDecoderConfiguration.class).run((context) -> { |
114 | | - assertThat(context).hasSingleBean(ReactiveJwtDecoder.class); |
115 | | - assertThat(context).doesNotHaveBean(ReactiveUserDetailsService.class); |
116 | | - }); |
117 | | - } |
118 | | - |
119 | 110 | @Test |
120 | 111 | void doesNotConfigureDefaultUserIfResourceServerIsPresent() { |
121 | 112 | this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean(ReactiveUserDetailsService.class)); |
@@ -232,24 +223,4 @@ PasswordEncoder passwordEncoder() { |
232 | 223 |
|
233 | 224 | } |
234 | 225 |
|
235 | | - @Configuration(proxyBeanMethods = false) |
236 | | - static class JwtDecoderConfiguration { |
237 | | - |
238 | | - @Bean |
239 | | - ReactiveJwtDecoder jwtDecoder() { |
240 | | - return mock(ReactiveJwtDecoder.class); |
241 | | - } |
242 | | - |
243 | | - } |
244 | | - |
245 | | - @Configuration(proxyBeanMethods = false) |
246 | | - static class ReactiveOpaqueTokenIntrospectorConfiguration { |
247 | | - |
248 | | - @Bean |
249 | | - ReactiveOpaqueTokenIntrospector introspectionClient() { |
250 | | - return mock(ReactiveOpaqueTokenIntrospector.class); |
251 | | - } |
252 | | - |
253 | | - } |
254 | | - |
255 | 226 | } |
0 commit comments