File tree Expand file tree Collapse file tree 2 files changed +2
-40
lines changed
main/java/org/springframework/security/authentication
test/java/org/springframework/security/authentication Expand file tree Collapse file tree 2 files changed +2
-40
lines changed Original file line number Diff line number Diff line change 1818
1919import org .apache .commons .logging .Log ;
2020import org .apache .commons .logging .LogFactory ;
21- import org .springframework .beans .factory .DisposableBean ;
2221import reactor .core .publisher .Mono ;
2322import reactor .core .scheduler .Scheduler ;
2423import reactor .core .scheduler .Schedulers ;
4645 * @author Eddú Meléndez
4746 * @since 5.2
4847 */
49- public abstract class AbstractUserDetailsReactiveAuthenticationManager implements ReactiveAuthenticationManager , DisposableBean {
48+ public abstract class AbstractUserDetailsReactiveAuthenticationManager implements ReactiveAuthenticationManager {
5049
5150 protected final Log logger = LogFactory .getLog (getClass ());
5251
@@ -56,9 +55,7 @@ public abstract class AbstractUserDetailsReactiveAuthenticationManager implement
5655
5756 private ReactiveUserDetailsPasswordService userDetailsPasswordService ;
5857
59- private final Scheduler DEFAULT_SCHEDULER = Schedulers .newParallel ("password-encoder" );
60-
61- private Scheduler scheduler = this .DEFAULT_SCHEDULER ;
58+ private Scheduler scheduler = Schedulers .newParallel ("password-encoder" );
6259
6360 private UserDetailsChecker preAuthenticationChecks = user -> {
6461 if (!user .isAccountNonLocked ()) {
@@ -174,8 +171,4 @@ public void setPostAuthenticationChecks(UserDetailsChecker postAuthenticationChe
174171 */
175172 protected abstract Mono <UserDetails > retrieveUser (String username );
176173
177- @ Override
178- public void destroy () {
179- this .DEFAULT_SCHEDULER .dispose ();
180- }
181174}
Original file line number Diff line number Diff line change 3333import org .springframework .security .core .userdetails .UserDetails ;
3434import org .springframework .security .crypto .password .PasswordEncoder ;
3535import reactor .core .publisher .Mono ;
36- import reactor .core .scheduler .Scheduler ;
37- import reactor .core .scheduler .Schedulers ;
3836import reactor .test .StepVerifier ;
3937
4038/**
@@ -138,33 +136,4 @@ public void authenticateWhenPasswordEncoderAndFailThenFail() {
138136 .expectError (BadCredentialsException .class )
139137 .verify ();
140138 }
141-
142- @ Test
143- public void destroyWhenDefaultSchedulerThenShouldDispose () {
144- assertThat (manager .scheduler .isDisposed ()).isFalse ();
145- manager .destroy ();
146- assertThat (manager .scheduler .isDisposed ())
147- .as ("default Scheduler should be disposed" )
148- .isTrue ();
149- }
150-
151- @ Test
152- public void destroyWhenCustomSchedulerThenShouldNotDispose () {
153- manager .setScheduler (Schedulers .parallel ());
154- manager .destroy ();
155- assertThat (manager .scheduler .isDisposed ())
156- .as ("custom Scheduler should not be disposed" )
157- .isFalse ();
158- }
159-
160- @ Test
161- public void setSchedulerWhenSetCustomSchedulerThenDisposeDefault () {
162- Scheduler defaultScheduler = manager .scheduler ;
163- assertThat (defaultScheduler .isDisposed ()).isFalse ();
164- manager .setScheduler (Schedulers .parallel ());
165- assertThat (defaultScheduler .isDisposed ())
166- .as ("default Scheduler should be disposed" )
167- .isTrue ();
168- }
169-
170139}
You can’t perform that action at this time.
0 commit comments