Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
41b2e584
Commit
41b2e584
authored
Oct 21, 2014
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
186b3a66
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
18 deletions
+18
-18
SecurityAutoConfigurationTests.java
...utoconfigure/security/SecurityAutoConfigurationTests.java
+7
-7
SpringBootWebSecurityConfigurationTests.java
...ure/security/SpringBootWebSecurityConfigurationTests.java
+11
-11
No files found.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SecurityAutoConfigurationTests.java
View file @
41b2e584
...
@@ -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
;
...
@@ -51,6 +46,11 @@ import org.springframework.security.web.FilterChainProxy;
...
@@ -51,6 +46,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}.
*
*
...
@@ -62,8 +62,8 @@ public class SecurityAutoConfigurationTests {
...
@@ -62,8 +62,8 @@ public class SecurityAutoConfigurationTests {
@After
@After
public
void
close
()
{
public
void
close
()
{
if
(
context
!=
null
)
{
if
(
this
.
context
!=
null
)
{
context
.
close
();
this
.
context
.
close
();
}
}
}
}
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfigurationTests.java
View file @
41b2e584
...
@@ -16,9 +16,6 @@
...
@@ -16,9 +16,6 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
security
;
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.Documented
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.ElementType
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.Retention
;
...
@@ -48,6 +45,9 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
...
@@ -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.builders.WebSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
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}.
* Tests for {@link SpringBootWebSecurityConfiguration}.
*
*
...
@@ -59,8 +59,8 @@ public class SpringBootWebSecurityConfigurationTests {
...
@@ -59,8 +59,8 @@ public class SpringBootWebSecurityConfigurationTests {
@After
@After
public
void
close
()
{
public
void
close
()
{
if
(
context
!=
null
)
{
if
(
this
.
context
!=
null
)
{
context
.
close
();
this
.
context
.
close
();
}
}
}
}
...
@@ -95,7 +95,7 @@ public class SpringBootWebSecurityConfigurationTests {
...
@@ -95,7 +95,7 @@ public class SpringBootWebSecurityConfigurationTests {
WebSecurityConfigurerAdapter
{
WebSecurityConfigurerAdapter
{
// It's a bad idea to inject an AuthenticationManager into a
// It's a bad idea to inject an AuthenticationManager into a
// WebSecurityConfigurerAdapter because it can cascade early instantiation,
// WebSecurityConfigurerAdapter because it can cascade early instantiation,
// unless you explicitly want the Boot default AuthenticationManager. It's
// unless you explicitly want the Boot default AuthenticationManager. It's
// better to inject the builder, if you want the global AuthenticationManager. It
// better to inject the builder, if you want the global AuthenticationManager. It
// might even be necessary to wrap the builder in a lazy AuthenticationManager
// might even be necessary to wrap the builder in a lazy AuthenticationManager
...
@@ -106,8 +106,9 @@ public class SpringBootWebSecurityConfigurationTests {
...
@@ -106,8 +106,9 @@ public class SpringBootWebSecurityConfigurationTests {
@Override
@Override
public
void
init
(
WebSecurity
web
)
throws
Exception
{
public
void
init
(
WebSecurity
web
)
throws
Exception
{
auth
.
getOrBuild
();
this
.
auth
.
getOrBuild
();
}
}
}
}
@MinimalWebConfiguration
@MinimalWebConfiguration
...
@@ -118,10 +119,8 @@ public class SpringBootWebSecurityConfigurationTests {
...
@@ -118,10 +119,8 @@ public class SpringBootWebSecurityConfigurationTests {
@Autowired
@Autowired
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
// @formatter:off
// @formatter:off
auth
.
inMemoryAuthentication
()
auth
.
inMemoryAuthentication
().
withUser
(
"dave"
).
password
(
"secret"
)
.
withUser
(
"dave"
)
.
roles
(
"USER"
);
.
password
(
"secret"
)
.
roles
(
"USER"
);
// @formatter:on
// @formatter:on
}
}
...
@@ -142,6 +141,7 @@ public class SpringBootWebSecurityConfigurationTests {
...
@@ -142,6 +141,7 @@ public class SpringBootWebSecurityConfigurationTests {
HttpMessageConvertersAutoConfiguration
.
class
,
HttpMessageConvertersAutoConfiguration
.
class
,
ErrorMvcAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
ErrorMvcAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
protected
static
@interface
MinimalWebConfiguration
{
protected
static
@interface
MinimalWebConfiguration
{
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment