|
16 | 16 |
|
17 | 17 | package org.springframework.boot.autoconfigure.security;
|
18 | 18 |
|
19 |
| -import static org.junit.Assert.assertEquals; |
20 |
| -import static org.junit.Assert.assertNotNull; |
21 |
| -import static org.junit.Assert.assertTrue; |
22 |
| -import static org.junit.Assert.fail; |
23 |
| - |
24 | 19 | import java.util.List;
|
25 | 20 | import java.util.concurrent.atomic.AtomicReference;
|
26 | 21 |
|
|
58 | 53 | import org.springframework.security.web.SecurityFilterChain;
|
59 | 54 | import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
|
60 | 55 |
|
| 56 | +import static org.junit.Assert.assertEquals; |
| 57 | +import static org.junit.Assert.assertNotNull; |
| 58 | +import static org.junit.Assert.assertTrue; |
| 59 | +import static org.junit.Assert.fail; |
| 60 | + |
61 | 61 | /**
|
62 | 62 | * Tests for {@link SecurityAutoConfiguration}.
|
63 | 63 | *
|
@@ -291,21 +291,23 @@ protected static class SecurityCustomizer extends WebSecurityConfigurerAdapter {
|
291 | 291 | }
|
292 | 292 |
|
293 | 293 | @Configuration
|
294 |
| - protected static class WorkaroundSecurityCustomizer extends WebSecurityConfigurerAdapter { |
| 294 | + protected static class WorkaroundSecurityCustomizer extends |
| 295 | + WebSecurityConfigurerAdapter { |
295 | 296 |
|
296 | 297 | @Autowired
|
297 | 298 | private AuthenticationManagerBuilder builder;
|
298 |
| - |
| 299 | + |
299 | 300 | @SuppressWarnings("unused")
|
300 | 301 | private AuthenticationManager authenticationManager;
|
301 |
| - |
| 302 | + |
302 | 303 | @Override
|
303 | 304 | protected void configure(HttpSecurity http) throws Exception {
|
304 |
| - authenticationManager = new AuthenticationManager() { |
| 305 | + this.authenticationManager = new AuthenticationManager() { |
305 | 306 | @Override
|
306 | 307 | public Authentication authenticate(Authentication authentication)
|
307 | 308 | throws AuthenticationException {
|
308 |
| - return builder.getOrBuild().authenticate(authentication); |
| 309 | + return WorkaroundSecurityCustomizer.this.builder.getOrBuild() |
| 310 | + .authenticate(authentication); |
309 | 311 | }
|
310 | 312 | };
|
311 | 313 | }
|
|
0 commit comments