Skip to content

Commit aab929d

Browse files
committed
Polish ReactiveUserDetailsServiceAutoConfigurationTests
Closes gh-44934
1 parent d1345c4 commit aab929d

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveUserDetailsServiceAutoConfigurationTests.java

+1-30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -41,7 +41,6 @@
4141
import org.springframework.security.core.userdetails.UserDetails;
4242
import org.springframework.security.crypto.password.PasswordEncoder;
4343
import org.springframework.security.oauth2.client.registration.ClientRegistrationRepository;
44-
import org.springframework.security.oauth2.jwt.ReactiveJwtDecoder;
4544
import org.springframework.security.oauth2.server.resource.introspection.ReactiveOpaqueTokenIntrospector;
4645

4746
import static org.assertj.core.api.Assertions.assertThat;
@@ -108,14 +107,6 @@ void doesNotConfigureDefaultUserIfAuthenticationManagerResolverAvailable() {
108107
.doesNotHaveBean(ReactiveUserDetailsService.class));
109108
}
110109

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-
119110
@Test
120111
void doesNotConfigureDefaultUserIfResourceServerIsPresent() {
121112
this.contextRunner.run((context) -> assertThat(context).doesNotHaveBean(ReactiveUserDetailsService.class));
@@ -232,24 +223,4 @@ PasswordEncoder passwordEncoder() {
232223

233224
}
234225

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-
255226
}

0 commit comments

Comments
 (0)