Commit 8e16dfc9 authored by Phillip Webb's avatar Phillip Webb

Polish

parent f15cb7a7
...@@ -16,11 +16,6 @@ ...@@ -16,11 +16,6 @@
package org.springframework.boot.autoconfigure.security; package org.springframework.boot.autoconfigure.security;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
...@@ -58,6 +53,11 @@ import org.springframework.security.web.FilterChainProxy; ...@@ -58,6 +53,11 @@ import org.springframework.security.web.FilterChainProxy;
import org.springframework.security.web.SecurityFilterChain; import org.springframework.security.web.SecurityFilterChain;
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
/** /**
* Tests for {@link SecurityAutoConfiguration}. * Tests for {@link SecurityAutoConfiguration}.
* *
...@@ -291,21 +291,23 @@ public class SecurityAutoConfigurationTests { ...@@ -291,21 +291,23 @@ public class SecurityAutoConfigurationTests {
} }
@Configuration @Configuration
protected static class WorkaroundSecurityCustomizer extends WebSecurityConfigurerAdapter { protected static class WorkaroundSecurityCustomizer extends
WebSecurityConfigurerAdapter {
@Autowired @Autowired
private AuthenticationManagerBuilder builder; private AuthenticationManagerBuilder builder;
@SuppressWarnings("unused") @SuppressWarnings("unused")
private AuthenticationManager authenticationManager; private AuthenticationManager authenticationManager;
@Override @Override
protected void configure(HttpSecurity http) throws Exception { protected void configure(HttpSecurity http) throws Exception {
authenticationManager = new AuthenticationManager() { this.authenticationManager = new AuthenticationManager() {
@Override @Override
public Authentication authenticate(Authentication authentication) public Authentication authenticate(Authentication authentication)
throws AuthenticationException { throws AuthenticationException {
return builder.getOrBuild().authenticate(authentication); return WorkaroundSecurityCustomizer.this.builder.getOrBuild()
.authenticate(authentication);
} }
}; };
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment