diff --git a/acl/pom.xml b/acl/pom.xml
index 4b3ddba5af..d8dd7c16ee 100644
--- a/acl/pom.xml
+++ b/acl/pom.xml
@@ -64,19 +64,19 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -88,13 +88,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -150,19 +150,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/aspects/pom.xml b/aspects/pom.xml
index de279fc98f..28c1bb61df 100644
--- a/aspects/pom.xml
+++ b/aspects/pom.xml
@@ -58,19 +58,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -132,13 +132,13 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/build.gradle b/build.gradle
index 3647926284..4abaf2b927 100644
--- a/build.gradle
+++ b/build.gradle
@@ -25,7 +25,7 @@ allprojects {
ext.releaseBuild = version.endsWith('RELEASE')
ext.snapshotBuild = version.endsWith('SNAPSHOT')
- ext.springVersion = '4.0.2.RELEASE'
+ ext.springVersion = '4.1.0.BUILD-SNAPSHOT'
ext.springLdapVersion = '2.0.1.RELEASE'
group = 'org.springframework.security'
diff --git a/cas/pom.xml b/cas/pom.xml
index 824796bc6f..3c41a92c90 100644
--- a/cas/pom.xml
+++ b/cas/pom.xml
@@ -70,19 +70,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -94,7 +94,7 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -150,7 +150,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/config/pom.xml b/config/pom.xml
index 9cfef6ffa1..96ac8f0e22 100644
--- a/config/pom.xml
+++ b/config/pom.xml
@@ -64,25 +64,25 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -129,28 +129,28 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
@@ -385,19 +385,19 @@
org.springframework
spring-expression
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-orm
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/core/pom.xml b/core/pom.xml
index 3cd89d4bf6..32ec307b22 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -58,25 +58,25 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -88,7 +88,7 @@
org.springframework
spring-expression
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -122,14 +122,14 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
@@ -280,7 +280,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/crypto/pom.xml b/crypto/pom.xml
index 0217c3d953..5f9a92e80a 100644
--- a/crypto/pom.xml
+++ b/crypto/pom.xml
@@ -52,7 +52,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -101,7 +101,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/itest/context/pom.xml b/itest/context/pom.xml
index 3b96571829..717c360e6a 100644
--- a/itest/context/pom.xml
+++ b/itest/context/pom.xml
@@ -70,25 +70,25 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -100,7 +100,7 @@
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -167,13 +167,13 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/itest/web/pom.xml b/itest/web/pom.xml
index a4072808f4..30f2f8ab82 100644
--- a/itest/web/pom.xml
+++ b/itest/web/pom.xml
@@ -52,13 +52,13 @@
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -70,7 +70,7 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -201,19 +201,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/ldap/pom.xml b/ldap/pom.xml
index 575f499775..87ef3c3ed6 100644
--- a/ldap/pom.xml
+++ b/ldap/pom.xml
@@ -82,19 +82,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -106,7 +106,7 @@
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -204,7 +204,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/openid/pom.xml b/openid/pom.xml
index d72edbb26a..fc653eed64 100644
--- a/openid/pom.xml
+++ b/openid/pom.xml
@@ -82,25 +82,25 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -112,7 +112,7 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -173,7 +173,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/remoting/pom.xml b/remoting/pom.xml
index c643ed0b12..a8c5f05594 100644
--- a/remoting/pom.xml
+++ b/remoting/pom.xml
@@ -64,19 +64,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -88,7 +88,7 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -131,7 +131,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/aspectj-xml/pom.xml b/samples/aspectj-xml/pom.xml
index 65695cd4ed..702ea66162 100644
--- a/samples/aspectj-xml/pom.xml
+++ b/samples/aspectj-xml/pom.xml
@@ -58,7 +58,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -126,7 +126,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/cas/sample-xml/pom.xml b/samples/cas/sample-xml/pom.xml
index 3ef3ad2aae..2ea29d17d3 100644
--- a/samples/cas/sample-xml/pom.xml
+++ b/samples/cas/sample-xml/pom.xml
@@ -78,7 +78,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -133,7 +133,7 @@
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
runtime
@@ -217,7 +217,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/cas/server/pom.xml b/samples/cas/server/pom.xml
index 206b11f9cc..07dd7a722a 100644
--- a/samples/cas/server/pom.xml
+++ b/samples/cas/server/pom.xml
@@ -60,7 +60,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -109,7 +109,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/concurrency-jc/pom.xml b/samples/concurrency-jc/pom.xml
index 32f7986370..ba2a3ef022 100644
--- a/samples/concurrency-jc/pom.xml
+++ b/samples/concurrency-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -211,7 +211,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/contacts-xml/pom.xml b/samples/contacts-xml/pom.xml
index 57a896e796..34d820988b 100644
--- a/samples/contacts-xml/pom.xml
+++ b/samples/contacts-xml/pom.xml
@@ -72,25 +72,25 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -102,25 +102,25 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -193,7 +193,7 @@
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
runtime
@@ -265,7 +265,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/dms-xml/pom.xml b/samples/dms-xml/pom.xml
index 3a2badaf4b..14e1b0a790 100644
--- a/samples/dms-xml/pom.xml
+++ b/samples/dms-xml/pom.xml
@@ -64,13 +64,13 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -82,13 +82,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -120,7 +120,7 @@
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
runtime
@@ -156,13 +156,13 @@
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/form-jc/pom.xml b/samples/form-jc/pom.xml
index 5f90bf2220..07c45dc4f0 100644
--- a/samples/form-jc/pom.xml
+++ b/samples/form-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -259,7 +259,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/gae-xml/pom.xml b/samples/gae-xml/pom.xml
index b4199b42d9..aab8223f64 100644
--- a/samples/gae-xml/pom.xml
+++ b/samples/gae-xml/pom.xml
@@ -96,25 +96,25 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -126,13 +126,13 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -217,7 +217,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/hellojs-jc/pom.xml b/samples/hellojs-jc/pom.xml
index 2d40d44f42..c5da699b9b 100644
--- a/samples/hellojs-jc/pom.xml
+++ b/samples/hellojs-jc/pom.xml
@@ -132,7 +132,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -144,13 +144,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -217,7 +217,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/hellomvc-jc/pom.xml b/samples/hellomvc-jc/pom.xml
index d44f809973..3b7f46be13 100644
--- a/samples/hellomvc-jc/pom.xml
+++ b/samples/hellomvc-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -217,7 +217,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/helloworld-jc/pom.xml b/samples/helloworld-jc/pom.xml
index c34639623c..25c72ec23b 100644
--- a/samples/helloworld-jc/pom.xml
+++ b/samples/helloworld-jc/pom.xml
@@ -90,7 +90,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -193,7 +193,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/inmemory-jc/pom.xml b/samples/inmemory-jc/pom.xml
index 24832c08be..3ce0aa2162 100644
--- a/samples/inmemory-jc/pom.xml
+++ b/samples/inmemory-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -217,7 +217,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/insecure/pom.xml b/samples/insecure/pom.xml
index 3bf3b5affc..63bb2e8c42 100644
--- a/samples/insecure/pom.xml
+++ b/samples/insecure/pom.xml
@@ -78,7 +78,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -112,28 +112,76 @@
0.9.29
runtime
+
+ commons-httpclient
+ commons-httpclient
+ 3.1
+ test
+
junit
junit
4.11
test
+
+ org.codehaus.groovy
+ groovy
+ 2.0.5
+ test
+
org.easytesting
fest-assert
1.4
test
+
+ org.gebish
+ geb-spock
+ 0.9.0
+ test
+
org.mockito
mockito-core
1.9.5
test
+
+ org.seleniumhq.selenium
+ selenium-htmlunit-driver
+ 2.33.0
+ test
+
+
+ org.spockframework
+ spock-core
+ 0.7-groovy-2.0
+ test
+
+
+ junit-dep
+ junit
+
+
+
+
+ org.spockframework
+ spock-spring
+ 0.7-groovy-2.0
+ test
+
+
+ junit-dep
+ junit
+
+
+
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/insecuremvc/pom.xml b/samples/insecuremvc/pom.xml
index c8915167e0..c53f022b6b 100644
--- a/samples/insecuremvc/pom.xml
+++ b/samples/insecuremvc/pom.xml
@@ -108,7 +108,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -120,13 +120,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -193,7 +193,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/jaas-xml/pom.xml b/samples/jaas-xml/pom.xml
index a616b17d27..8cdea62636 100644
--- a/samples/jaas-xml/pom.xml
+++ b/samples/jaas-xml/pom.xml
@@ -66,19 +66,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -90,7 +90,7 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -151,7 +151,7 @@
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
runtime
@@ -223,7 +223,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/jdbc-jc/pom.xml b/samples/jdbc-jc/pom.xml
index e9f771f6ac..52fbd4c2bc 100644
--- a/samples/jdbc-jc/pom.xml
+++ b/samples/jdbc-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -190,28 +190,76 @@
0.9.29
test
+
+ commons-httpclient
+ commons-httpclient
+ 3.1
+ test
+
junit
junit
4.11
test
+
+ org.codehaus.groovy
+ groovy
+ 2.0.5
+ test
+
org.easytesting
fest-assert
1.4
test
+
+ org.gebish
+ geb-spock
+ 0.9.0
+ test
+
org.mockito
mockito-core
1.9.5
test
+
+ org.seleniumhq.selenium
+ selenium-htmlunit-driver
+ 2.33.0
+ test
+
+
+ org.spockframework
+ spock-core
+ 0.7-groovy-2.0
+ test
+
+
+ junit-dep
+ junit
+
+
+
+
+ org.spockframework
+ spock-spring
+ 0.7-groovy-2.0
+ test
+
+
+ junit-dep
+ junit
+
+
+
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/ldap-jc/pom.xml b/samples/ldap-jc/pom.xml
index 52444f55ae..641e0ce050 100644
--- a/samples/ldap-jc/pom.xml
+++ b/samples/ldap-jc/pom.xml
@@ -168,7 +168,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -180,13 +180,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -301,7 +301,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/ldap-xml/pom.xml b/samples/ldap-xml/pom.xml
index f3d2d9b256..363eb4f529 100644
--- a/samples/ldap-xml/pom.xml
+++ b/samples/ldap-xml/pom.xml
@@ -57,10 +57,28 @@
+
+ javax.servlet.jsp.jstl
+ javax.servlet.jsp.jstl-api
+ 1.2.1
+ compile
+
+
+ org.apache.taglibs
+ taglibs-standard-jstlel
+ 1.2.1
+ compile
+
+
+ org.springframework.security
+ spring-security-taglibs
+ 4.0.0.CI-SNAPSHOT
+ compile
+
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -142,28 +160,76 @@
4.0.0.CI-SNAPSHOT
runtime
+
+ commons-httpclient
+ commons-httpclient
+ 3.1
+ test
+
junit
junit
4.11
test
+
+ org.codehaus.groovy
+ groovy
+ 2.0.5
+ test
+
org.easytesting
fest-assert
1.4
test
+
+ org.gebish
+ geb-spock
+ 0.9.0
+ test
+
org.mockito
mockito-core
1.9.5
test
+
+ org.seleniumhq.selenium
+ selenium-htmlunit-driver
+ 2.33.0
+ test
+
+
+ org.spockframework
+ spock-core
+ 0.7-groovy-2.0
+ test
+
+
+ junit-dep
+ junit
+
+
+
+
+ org.spockframework
+ spock-spring
+ 0.7-groovy-2.0
+ test
+
+
+ junit-dep
+ junit
+
+
+
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/messages-jc/pom.xml b/samples/messages-jc/pom.xml
index 43f97d2a40..8eedcb60f0 100644
--- a/samples/messages-jc/pom.xml
+++ b/samples/messages-jc/pom.xml
@@ -112,31 +112,31 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-aspects
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -148,31 +148,31 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-instrument
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-orm
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -233,7 +233,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/openid-jc/pom.xml b/samples/openid-jc/pom.xml
index ced448460c..233db1e65a 100644
--- a/samples/openid-jc/pom.xml
+++ b/samples/openid-jc/pom.xml
@@ -132,7 +132,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -144,13 +144,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -223,7 +223,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/openid-xml/pom.xml b/samples/openid-xml/pom.xml
index a26f5ec18b..697d03e40d 100644
--- a/samples/openid-xml/pom.xml
+++ b/samples/openid-xml/pom.xml
@@ -72,7 +72,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -151,7 +151,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/preauth-jc/pom.xml b/samples/preauth-jc/pom.xml
index 631efa918f..96cb48a0df 100644
--- a/samples/preauth-jc/pom.xml
+++ b/samples/preauth-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -211,7 +211,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/preauth-xml/pom.xml b/samples/preauth-xml/pom.xml
index 31090c19b6..43131847b1 100644
--- a/samples/preauth-xml/pom.xml
+++ b/samples/preauth-xml/pom.xml
@@ -60,7 +60,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -121,7 +121,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/rememberme-jc/pom.xml b/samples/rememberme-jc/pom.xml
index 9217c32f64..28da672973 100644
--- a/samples/rememberme-jc/pom.xml
+++ b/samples/rememberme-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -211,7 +211,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/servletapi-xml/pom.xml b/samples/servletapi-xml/pom.xml
index 8cbdec094c..3e98275188 100644
--- a/samples/servletapi-xml/pom.xml
+++ b/samples/servletapi-xml/pom.xml
@@ -78,19 +78,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -102,13 +102,13 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -157,7 +157,7 @@
org.springframework
spring-context-support
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
runtime
@@ -181,7 +181,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/tutorial-xml/pom.xml b/samples/tutorial-xml/pom.xml
index 6c84268a96..0f313ff1fc 100644
--- a/samples/tutorial-xml/pom.xml
+++ b/samples/tutorial-xml/pom.xml
@@ -72,13 +72,13 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -90,13 +90,13 @@
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -181,7 +181,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/samples/x509-jc/pom.xml b/samples/x509-jc/pom.xml
index a3948b050c..b13069fd69 100644
--- a/samples/x509-jc/pom.xml
+++ b/samples/x509-jc/pom.xml
@@ -126,7 +126,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -138,13 +138,13 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -211,7 +211,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/taglibs/pom.xml b/taglibs/pom.xml
index fa355ab404..d83acc7f12 100644
--- a/taglibs/pom.xml
+++ b/taglibs/pom.xml
@@ -70,25 +70,25 @@
org.springframework
spring-aop
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -100,13 +100,13 @@
org.springframework
spring-expression
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -197,7 +197,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/test/pom.xml b/test/pom.xml
index b9c5584dbb..50a6ad6941 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -64,7 +64,7 @@
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -76,7 +76,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -86,6 +86,13 @@
compile
true
+
+ org.springframework.security
+ spring-security-config
+ 4.0.0.CI-SNAPSHOT
+ compile
+ true
+
javax.servlet
javax.servlet-api
@@ -164,16 +171,10 @@
1.7.5
test
-
- org.springframework.security
- spring-security-config
- 4.0.0.CI-SNAPSHOT
- test
-
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test
diff --git a/test/src/main/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurer.java b/test/src/main/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurer.java
new file mode 100644
index 0000000000..0345be746c
--- /dev/null
+++ b/test/src/main/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurer.java
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2002-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.springframework.security.test.web.servlet.setup;
+
+import org.springframework.security.config.BeanIds;
+import org.springframework.test.web.servlet.request.RequestPostProcessor;
+import org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder;
+import org.springframework.test.web.servlet.setup.MockMvcConfigurerAdapter;
+import org.springframework.util.Assert;
+import org.springframework.web.context.WebApplicationContext;
+
+import javax.servlet.Filter;
+
+import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.testSecurityContext;
+
+/**
+ * Configures Spring Security by adding the springSecurityFilterChain and adding the {@link org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors#testSecurityContext()}.
+ *
+ * @author Rob Winch
+ * @since 4.0
+ */
+final class SecurityMockMvcConfigurer extends MockMvcConfigurerAdapter {
+ private Filter springSecurityFilterChain;
+
+ /**
+ * Creates a new instance
+ */
+ SecurityMockMvcConfigurer() {}
+
+ /**
+ * Creates a new instance with the provided {@link javax.servlet.Filter}
+ * @param springSecurityFilterChain the {@link javax.servlet.Filter} to use
+ */
+ SecurityMockMvcConfigurer(Filter springSecurityFilterChain) {
+ this.springSecurityFilterChain = springSecurityFilterChain;
+ }
+
+ @Override
+ public RequestPostProcessor beforeMockMvcCreated(ConfigurableMockMvcBuilder> builder, WebApplicationContext context) {
+ String securityBeanId = BeanIds.SPRING_SECURITY_FILTER_CHAIN;
+ if(springSecurityFilterChain == null && context.containsBean(securityBeanId)) {
+ springSecurityFilterChain = context.getBean(securityBeanId, Filter.class);
+ }
+
+ if(springSecurityFilterChain == null) {
+ throw new IllegalStateException("springSecurityFilterChain cannot be null. Ensure a Bean with the name "+ securityBeanId + " implementing Filter is present or inject the Filter to be used.");
+ }
+
+ builder.addFilters(springSecurityFilterChain);
+
+ return testSecurityContext();
+ }
+}
diff --git a/test/src/main/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurers.java b/test/src/main/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurers.java
new file mode 100644
index 0000000000..c06909bae9
--- /dev/null
+++ b/test/src/main/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurers.java
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2002-2013 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.springframework.security.test.web.servlet.setup;
+
+import org.springframework.test.web.servlet.setup.MockMvcConfigurer;
+import org.springframework.util.Assert;
+
+import javax.servlet.Filter;
+
+/**
+ * Provides Security related {@link org.springframework.test.web.servlet.setup.MockMvcConfigurer} implementations.
+ *
+ * @since 4.0
+ * @author Rob Winch
+ */
+public final class SecurityMockMvcConfigurers {
+ /**
+ * Configures the MockMvcBuilder for use with Spring Security. Specifically the configurer adds the Spring Bean
+ * named "springSecurityFilterChain" as a Filter. It will also ensure that the TestSecurityContextHolder is leveraged
+ * for each request by applying {@link org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors#testSecurityContext()}.
+ *
+ * @return the {@link org.springframework.test.web.servlet.setup.MockMvcConfigurer} to use
+ */
+ public static MockMvcConfigurer springSecurity() {
+ return new SecurityMockMvcConfigurer();
+ }
+
+ /**
+ * Configures the MockMvcBuilder for use with Spring Security. Specifically the configurer adds the provided Filter. It will also ensure that the
+ * TestSecurityContextHolder is leveraged for each request by applying
+ * {@link org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors#testSecurityContext()}.
+ *
+ * @param springSecurityFilterChain the Filter to be added
+ *
+ * @return the {@link org.springframework.test.web.servlet.setup.MockMvcConfigurer} to use
+ */
+ public static MockMvcConfigurer springSecurity(Filter springSecurityFilterChain) {
+ Assert.notNull(springSecurityFilterChain, "springSecurityFilterChain cannot be null");
+ return new SecurityMockMvcConfigurer(springSecurityFilterChain);
+ }
+}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurerTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurerTests.java
new file mode 100644
index 0000000000..b6e1843937
--- /dev/null
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/setup/SecurityMockMvcConfigurerTests.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2002-2014 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package org.springframework.security.test.web.servlet.setup;
+
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+import org.springframework.test.web.servlet.setup.ConfigurableMockMvcBuilder;
+import org.springframework.web.context.WebApplicationContext;
+
+import javax.servlet.Filter;
+
+import static org.mockito.Matchers.anyString;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+@RunWith(MockitoJUnitRunner.class)
+public class SecurityMockMvcConfigurerTests {
+ @Mock
+ private Filter filter;
+ @Mock
+ private Filter beanFilter;
+ @Mock
+ private ConfigurableMockMvcBuilder builder;
+ @Mock
+ private WebApplicationContext context;
+
+ @Test
+ public void beforeMockMvcCreatedOverrideBean() throws Exception {
+ returnFilterBean();
+ SecurityMockMvcConfigurer configurer = new SecurityMockMvcConfigurer(filter);
+
+ configurer.beforeMockMvcCreated(builder, context);
+
+ verify(builder).addFilters(filter);
+ }
+
+ @Test
+ public void beforeMockMvcCreatedBean() throws Exception {
+ returnFilterBean();
+ SecurityMockMvcConfigurer configurer = new SecurityMockMvcConfigurer();
+
+ configurer.beforeMockMvcCreated(builder, context);
+
+ verify(builder).addFilters(beanFilter);
+ }
+
+ @Test
+ public void beforeMockMvcCreatedNoBean() throws Exception {
+ SecurityMockMvcConfigurer configurer = new SecurityMockMvcConfigurer(filter);
+
+ configurer.beforeMockMvcCreated(builder, context);
+
+ verify(builder).addFilters(filter);
+ }
+
+
+ @Test(expected = IllegalStateException.class)
+ public void beforeMockMvcCreatedNoFilter() throws Exception {
+ SecurityMockMvcConfigurer configurer = new SecurityMockMvcConfigurer();
+
+ configurer.beforeMockMvcCreated(builder, context);
+ }
+
+ private void returnFilterBean() {
+ when(context.containsBean(anyString())).thenReturn(true);
+ when(context.getBean(anyString(),eq(Filter.class))).thenReturn(beanFilter);
+ }
+}
\ No newline at end of file
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CsrfShowcaseTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CsrfShowcaseTests.java
index d6a338be02..9f48c5aa8a 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CsrfShowcaseTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CsrfShowcaseTests.java
@@ -14,11 +14,6 @@
* limitations under the License.
*/
package org.springframework.security.test.web.servlet.showcase.csrf;
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-
-import javax.servlet.Filter;
import org.junit.Before;
import org.junit.Test;
@@ -29,6 +24,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -37,24 +33,28 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.csrf;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=CsrfShowcaseTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class CsrfShowcaseTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CustomCsrfShowcaseTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CustomCsrfShowcaseTests.java
index 262285dc6c..4c2fb8f3b4 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CustomCsrfShowcaseTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/CustomCsrfShowcaseTests.java
@@ -15,11 +15,10 @@
*/
package org.springframework.security.test.web.servlet.showcase.csrf;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -30,6 +29,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.security.web.csrf.CsrfTokenRepository;
import org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository;
import org.springframework.test.context.ContextConfiguration;
@@ -43,14 +43,12 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=CustomCsrfShowcaseTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class CustomCsrfShowcaseTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
@Autowired
private CsrfTokenRepository repository;
@@ -61,7 +59,7 @@ public class CustomCsrfShowcaseTests {
mvc = MockMvcBuilders
.webAppContextSetup(context)
.defaultRequest(get("/").with(csrf()))
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/DefaultCsrfShowcaseTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/DefaultCsrfShowcaseTests.java
index 43d898fdf8..ca5f5c7277 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/DefaultCsrfShowcaseTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/csrf/DefaultCsrfShowcaseTests.java
@@ -15,11 +15,10 @@
*/
package org.springframework.security.test.web.servlet.showcase.csrf;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -29,6 +28,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -40,14 +40,12 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=DefaultCsrfShowcaseTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class DefaultCsrfShowcaseTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
@@ -55,7 +53,7 @@ public class DefaultCsrfShowcaseTests {
mvc = MockMvcBuilders
.webAppContextSetup(context)
.defaultRequest(get("/").with(csrf()))
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/AuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/AuthenticationTests.java
index 8d02d52abe..de4cddea90 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/AuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/AuthenticationTests.java
@@ -17,12 +17,11 @@ package org.springframework.security.test.web.servlet.showcase.login;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -31,6 +30,7 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -42,21 +42,19 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=AuthenticationTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class AuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomConfigAuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomConfigAuthenticationTests.java
index 22e5d83fec..9040cc8158 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomConfigAuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomConfigAuthenticationTests.java
@@ -18,11 +18,10 @@ package org.springframework.security.test.web.servlet.showcase.login;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.*;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -33,6 +32,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.security.web.context.HttpSessionSecurityContextRepository;
import org.springframework.security.web.context.SecurityContextRepository;
import org.springframework.test.context.ContextConfiguration;
@@ -46,14 +46,12 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=CustomConfigAuthenticationTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class CustomConfigAuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
@Autowired
private SecurityContextRepository securityContextRepository;
@@ -63,8 +61,7 @@ public class CustomConfigAuthenticationTests {
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .defaultRequest(get("/"))
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomLoginRequestBuilderAuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomLoginRequestBuilderAuthenticationTests.java
index 9952b78296..be075c1dee 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomLoginRequestBuilderAuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/login/CustomLoginRequestBuilderAuthenticationTests.java
@@ -16,10 +16,9 @@
package org.springframework.security.test.web.servlet.showcase.login;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -29,6 +28,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders;
import org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestBuilders.FormLoginRequestBuilder;
import org.springframework.test.context.ContextConfiguration;
@@ -42,21 +42,19 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=CustomLoginRequestBuilderAuthenticationTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class CustomLoginRequestBuilderAuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/DefaultfSecurityRequestsTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/DefaultfSecurityRequestsTests.java
index 8224ba096b..6352b5d60f 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/DefaultfSecurityRequestsTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/DefaultfSecurityRequestsTests.java
@@ -17,6 +17,7 @@ package org.springframework.security.test.web.servlet.showcase.secured;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
@@ -31,6 +32,7 @@ import org.springframework.security.config.annotation.authentication.builders.Au
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -42,6 +44,7 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=DefaultfSecurityRequestsTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class DefaultfSecurityRequestsTests {
@Autowired
@@ -57,7 +60,7 @@ public class DefaultfSecurityRequestsTests {
mvc = MockMvcBuilders
.webAppContextSetup(context)
.defaultRequest(get("/").with(user("user").roles("ADMIN")))
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/SecurityRequestsTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/SecurityRequestsTests.java
index 82af6745f5..2e0be683dd 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/SecurityRequestsTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/SecurityRequestsTests.java
@@ -17,11 +17,10 @@ package org.springframework.security.test.web.servlet.showcase.secured;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.*;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.*;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -36,6 +35,7 @@ import org.springframework.security.config.annotation.web.servlet.configuration.
import org.springframework.security.core.Authentication;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
+import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -47,14 +47,12 @@ import org.springframework.web.servlet.config.annotation.EnableWebMvc;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=SecurityRequestsTests.Config.class)
@WebAppConfiguration
+@DefaultSecurityTestExecutionListeners
public class SecurityRequestsTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
@Autowired
private UserDetailsService userDetailsService;
@@ -64,7 +62,7 @@ public class SecurityRequestsTests {
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserAuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserAuthenticationTests.java
index 7bcdce9d92..7a0574b14f 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserAuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserAuthenticationTests.java
@@ -26,6 +26,7 @@ import org.springframework.security.config.annotation.web.configuration.WebSecur
import org.springframework.security.config.annotation.web.servlet.configuration.EnableWebMvcSecurity;
import org.springframework.security.test.context.DefaultSecurityTestExecutionListeners;
import org.springframework.security.test.context.support.WithMockUser;
+import org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
@@ -34,9 +35,6 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import javax.servlet.Filter;
-
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.testSecurityContext;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -50,17 +48,13 @@ public class WithUserAuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
- .defaultRequest(get("/").with(testSecurityContext()))
+ .apply(SecurityMockMvcConfigurers.springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserClassLevelAuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserClassLevelAuthenticationTests.java
index b5f88f07cb..fa02fd8130 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserClassLevelAuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserClassLevelAuthenticationTests.java
@@ -34,10 +34,8 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import javax.servlet.Filter;
-
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.testSecurityContext;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -51,17 +49,13 @@ public class WithUserClassLevelAuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
- .defaultRequest(get("/").with(testSecurityContext()))
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsAuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsAuthenticationTests.java
index 66b31a1ef1..4a2b49c3c2 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsAuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsAuthenticationTests.java
@@ -15,13 +15,6 @@
*/
package org.springframework.security.test.web.servlet.showcase.secured;
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.testSecurityContext;
-import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated;
-import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
-import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-
-import javax.servlet.Filter;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -43,6 +36,11 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
+import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
+
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes=WithUserDetailsAuthenticationTests.Config.class)
@WebAppConfiguration
@@ -52,17 +50,13 @@ public class WithUserDetailsAuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
- .defaultRequest(get("/").with(testSecurityContext()))
+ .apply(springSecurity())
.build();
}
diff --git a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsClassLevelAuthenticationTests.java b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsClassLevelAuthenticationTests.java
index c3b2a38869..c49bc320c8 100644
--- a/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsClassLevelAuthenticationTests.java
+++ b/test/src/test/java/org/springframework/security/test/web/servlet/showcase/secured/WithUserDetailsClassLevelAuthenticationTests.java
@@ -36,10 +36,8 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
-import javax.servlet.Filter;
-
-import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.testSecurityContext;
import static org.springframework.security.test.web.servlet.response.SecurityMockMvcResultMatchers.authenticated;
+import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
@@ -53,17 +51,13 @@ public class WithUserDetailsClassLevelAuthenticationTests {
@Autowired
private WebApplicationContext context;
- @Autowired
- private Filter springSecurityFilterChain;
-
private MockMvc mvc;
@Before
public void setup() {
mvc = MockMvcBuilders
.webAppContextSetup(context)
- .addFilters(springSecurityFilterChain)
- .defaultRequest(get("/").with(testSecurityContext()))
+ .apply(springSecurity())
.build();
}
diff --git a/test/test.gradle b/test/test.gradle
index df85d572bc..894f4644e6 100644
--- a/test/test.gradle
+++ b/test/test.gradle
@@ -5,9 +5,10 @@ dependencies {
project(':spring-security-web'),
"org.springframework:spring-test:$springVersion"
+ optional project(':spring-security-config')
+
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
- testCompile project(':spring-security-config'),
- "org.springframework:spring-webmvc:$springVersion",
+ testCompile "org.springframework:spring-webmvc:$springVersion",
powerMockDependencies
}
diff --git a/web/pom.xml b/web/pom.xml
index fe45622f27..55590c0e6b 100644
--- a/web/pom.xml
+++ b/web/pom.xml
@@ -64,19 +64,19 @@
org.springframework
spring-beans
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-context
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-core
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -88,13 +88,13 @@
org.springframework
spring-expression
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
org.springframework
spring-web
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
@@ -107,21 +107,21 @@
org.springframework
spring-jdbc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
org.springframework
spring-tx
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
org.springframework
spring-webmvc
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
compile
true
@@ -248,7 +248,7 @@
org.springframework
spring-test
- 4.0.2.RELEASE
+ 4.1.0.BUILD-SNAPSHOT
test