Skip to content

Commit 41b2e58

Browse files
committed
Polish
1 parent 186b3a6 commit 41b2e58

File tree

2 files changed

+18
-18
lines changed

2 files changed

+18
-18
lines changed

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
package org.springframework.boot.autoconfigure.security;
1818

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-
2419
import java.util.List;
2520
import java.util.concurrent.atomic.AtomicReference;
2621

@@ -51,6 +46,11 @@
5146
import org.springframework.security.web.SecurityFilterChain;
5247
import org.springframework.web.context.support.AnnotationConfigWebApplicationContext;
5348

49+
import static org.junit.Assert.assertEquals;
50+
import static org.junit.Assert.assertNotNull;
51+
import static org.junit.Assert.assertTrue;
52+
import static org.junit.Assert.fail;
53+
5454
/**
5555
* Tests for {@link SecurityAutoConfiguration}.
5656
*
@@ -62,8 +62,8 @@ public class SecurityAutoConfigurationTests {
6262

6363
@After
6464
public void close() {
65-
if (context != null) {
66-
context.close();
65+
if (this.context != null) {
66+
this.context.close();
6767
}
6868
}
6969

spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfigurationTests.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616

1717
package org.springframework.boot.autoconfigure.security;
1818

19-
import static org.junit.Assert.assertNotNull;
20-
import static org.junit.Assert.assertTrue;
21-
2219
import java.lang.annotation.Documented;
2320
import java.lang.annotation.ElementType;
2421
import java.lang.annotation.Retention;
@@ -48,6 +45,9 @@
4845
import org.springframework.security.config.annotation.web.builders.WebSecurity;
4946
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
5047

48+
import static org.junit.Assert.assertNotNull;
49+
import static org.junit.Assert.assertTrue;
50+
5151
/**
5252
* Tests for {@link SpringBootWebSecurityConfiguration}.
5353
*
@@ -59,8 +59,8 @@ public class SpringBootWebSecurityConfigurationTests {
5959

6060
@After
6161
public void close() {
62-
if (context != null) {
63-
context.close();
62+
if (this.context != null) {
63+
this.context.close();
6464
}
6565
}
6666

@@ -95,7 +95,7 @@ protected static class TestInjectWebConfiguration extends
9595
WebSecurityConfigurerAdapter {
9696

9797
// It's a bad idea to inject an AuthenticationManager into a
98-
// WebSecurityConfigurerAdapter because it can cascade early instantiation,
98+
// WebSecurityConfigurerAdapter because it can cascade early instantiation,
9999
// unless you explicitly want the Boot default AuthenticationManager. It's
100100
// better to inject the builder, if you want the global AuthenticationManager. It
101101
// might even be necessary to wrap the builder in a lazy AuthenticationManager
@@ -106,8 +106,9 @@ protected static class TestInjectWebConfiguration extends
106106

107107
@Override
108108
public void init(WebSecurity web) throws Exception {
109-
auth.getOrBuild();
109+
this.auth.getOrBuild();
110110
}
111+
111112
}
112113

113114
@MinimalWebConfiguration
@@ -118,10 +119,8 @@ protected static class TestWebConfiguration extends WebSecurityConfigurerAdapter
118119
@Autowired
119120
public void init(AuthenticationManagerBuilder auth) throws Exception {
120121
// @formatter:off
121-
auth.inMemoryAuthentication()
122-
.withUser("dave")
123-
.password("secret")
124-
.roles("USER");
122+
auth.inMemoryAuthentication().withUser("dave").password("secret")
123+
.roles("USER");
125124
// @formatter:on
126125
}
127126

@@ -142,6 +141,7 @@ protected void configure(HttpSecurity http) throws Exception {
142141
HttpMessageConvertersAutoConfiguration.class,
143142
ErrorMvcAutoConfiguration.class, PropertyPlaceholderAutoConfiguration.class })
144143
protected static @interface MinimalWebConfiguration {
144+
145145
}
146146

147147
}

0 commit comments

Comments
 (0)