16
16
17
17
package org .springframework .boot .autoconfigure .security ;
18
18
19
- import static org .junit .Assert .assertNotNull ;
20
- import static org .junit .Assert .assertTrue ;
21
-
22
19
import java .lang .annotation .Documented ;
23
20
import java .lang .annotation .ElementType ;
24
21
import java .lang .annotation .Retention ;
48
45
import org .springframework .security .config .annotation .web .builders .WebSecurity ;
49
46
import org .springframework .security .config .annotation .web .configuration .WebSecurityConfigurerAdapter ;
50
47
48
+ import static org .junit .Assert .assertNotNull ;
49
+ import static org .junit .Assert .assertTrue ;
50
+
51
51
/**
52
52
* Tests for {@link SpringBootWebSecurityConfiguration}.
53
53
*
@@ -59,8 +59,8 @@ public class SpringBootWebSecurityConfigurationTests {
59
59
60
60
@ After
61
61
public void close () {
62
- if (context != null ) {
63
- context .close ();
62
+ if (this . context != null ) {
63
+ this . context .close ();
64
64
}
65
65
}
66
66
@@ -95,7 +95,7 @@ protected static class TestInjectWebConfiguration extends
95
95
WebSecurityConfigurerAdapter {
96
96
97
97
// 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,
99
99
// unless you explicitly want the Boot default AuthenticationManager. It's
100
100
// better to inject the builder, if you want the global AuthenticationManager. It
101
101
// might even be necessary to wrap the builder in a lazy AuthenticationManager
@@ -106,8 +106,9 @@ protected static class TestInjectWebConfiguration extends
106
106
107
107
@ Override
108
108
public void init (WebSecurity web ) throws Exception {
109
- auth .getOrBuild ();
109
+ this . auth .getOrBuild ();
110
110
}
111
+
111
112
}
112
113
113
114
@ MinimalWebConfiguration
@@ -118,10 +119,8 @@ protected static class TestWebConfiguration extends WebSecurityConfigurerAdapter
118
119
@ Autowired
119
120
public void init (AuthenticationManagerBuilder auth ) throws Exception {
120
121
// @formatter:off
121
- auth .inMemoryAuthentication ()
122
- .withUser ("dave" )
123
- .password ("secret" )
124
- .roles ("USER" );
122
+ auth .inMemoryAuthentication ().withUser ("dave" ).password ("secret" )
123
+ .roles ("USER" );
125
124
// @formatter:on
126
125
}
127
126
@@ -142,6 +141,7 @@ protected void configure(HttpSecurity http) throws Exception {
142
141
HttpMessageConvertersAutoConfiguration .class ,
143
142
ErrorMvcAutoConfiguration .class , PropertyPlaceholderAutoConfiguration .class })
144
143
protected static @interface MinimalWebConfiguration {
144
+
145
145
}
146
146
147
147
}
0 commit comments