Commit 41b2e584 authored by Phillip Webb's avatar Phillip Webb

Polish

parent 186b3a66
......@@ -16,11 +16,6 @@
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.concurrent.atomic.AtomicReference;
......@@ -51,6 +46,11 @@ import org.springframework.security.web.FilterChainProxy;
import org.springframework.security.web.SecurityFilterChain;
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}.
*
......@@ -62,8 +62,8 @@ public class SecurityAutoConfigurationTests {
@After
public void close() {
if (context != null) {
context.close();
if (this.context != null) {
this.context.close();
}
}
......
......@@ -16,9 +16,6 @@
package org.springframework.boot.autoconfigure.security;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
......@@ -48,6 +45,9 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.builders.WebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
/**
* Tests for {@link SpringBootWebSecurityConfiguration}.
*
......@@ -59,8 +59,8 @@ public class SpringBootWebSecurityConfigurationTests {
@After
public void close() {
if (context != null) {
context.close();
if (this.context != null) {
this.context.close();
}
}
......@@ -106,8 +106,9 @@ public class SpringBootWebSecurityConfigurationTests {
@Override
public void init(WebSecurity web) throws Exception {
auth.getOrBuild();
this.auth.getOrBuild();
}
}
@MinimalWebConfiguration
......@@ -118,9 +119,7 @@ public class SpringBootWebSecurityConfigurationTests {
@Autowired
public void init(AuthenticationManagerBuilder auth) throws Exception {
// @formatter:off
auth.inMemoryAuthentication()
.withUser("dave")
.password("secret")
auth.inMemoryAuthentication().withUser("dave").password("secret")
.roles("USER");
// @formatter:on
}
......@@ -142,6 +141,7 @@ public class SpringBootWebSecurityConfigurationTests {
HttpMessageConvertersAutoConfiguration.class,
ErrorMvcAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
protected static @interface MinimalWebConfiguration {
}
}
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