From 7b158d05258340c944cabadeb0b183c7b4a0f210 Mon Sep 17 00:00:00 2001 From: Rob Winch Date: Thu, 7 May 2015 10:10:20 -0500 Subject: [PATCH] SEC-2966: Fix preauth-xml sample config attributes --- samples/preauth-xml/pom.xml | 12 ++++-- samples/preauth-xml/preauth.gradle | 4 ++ .../WEB-INF/applicationContext-security.xml | 2 +- .../src/test/java/sample/PreAuthXmlTests.java | 38 +++++++++++++++++++ 4 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 samples/preauth-xml/src/test/java/sample/PreAuthXmlTests.java diff --git a/samples/preauth-xml/pom.xml b/samples/preauth-xml/pom.xml index 8a84422b2a..cb0b8e34e7 100644 --- a/samples/preauth-xml/pom.xml +++ b/samples/preauth-xml/pom.xml @@ -3,7 +3,7 @@ 4.0.0 org.springframework.security spring-security-samples-preauth-xml - 4.0.1.CI-SNAPSHOT + 4.0.2.CI-SNAPSHOT war spring-security-samples-preauth-xml spring-security-samples-preauth-xml @@ -45,6 +45,12 @@ compile true + + javax.servlet + javax.servlet-api + 3.0.1 + provided + ch.qos.logback logback-classic @@ -60,13 +66,13 @@ org.springframework.security spring-security-config - 4.0.1.CI-SNAPSHOT + 4.0.2.CI-SNAPSHOT runtime org.springframework.security spring-security-web - 4.0.1.CI-SNAPSHOT + 4.0.2.CI-SNAPSHOT runtime diff --git a/samples/preauth-xml/preauth.gradle b/samples/preauth-xml/preauth.gradle index 24dcd70dd5..21935056ee 100644 --- a/samples/preauth-xml/preauth.gradle +++ b/samples/preauth-xml/preauth.gradle @@ -16,11 +16,15 @@ configurations { } dependencies { + providedCompile "javax.servlet:javax.servlet-api:3.0.1" runtime project(':spring-security-web'), project(':spring-security-config'), "org.slf4j:jcl-over-slf4j:$slf4jVersion", "ch.qos.logback:logback-classic:$logbackVersion" + + testCompile project(':spring-security-web'), + project(':spring-security-config') } jettyRun { diff --git a/samples/preauth-xml/src/main/webapp/WEB-INF/applicationContext-security.xml b/samples/preauth-xml/src/main/webapp/WEB-INF/applicationContext-security.xml index a8f7e5c98d..2a5ccaeed5 100644 --- a/samples/preauth-xml/src/main/webapp/WEB-INF/applicationContext-security.xml +++ b/samples/preauth-xml/src/main/webapp/WEB-INF/applicationContext-security.xml @@ -75,7 +75,7 @@ - + diff --git a/samples/preauth-xml/src/test/java/sample/PreAuthXmlTests.java b/samples/preauth-xml/src/test/java/sample/PreAuthXmlTests.java new file mode 100644 index 0000000000..40f9e8eaac --- /dev/null +++ b/samples/preauth-xml/src/test/java/sample/PreAuthXmlTests.java @@ -0,0 +1,38 @@ +/* + * Copyright 2002-2015 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 sample; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.web.FilterChainProxy; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.web.WebAppConfiguration; + +/** + * @author Rob Winch + */ +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration("file:src/main/webapp/WEB-INF/applicationContext-security.xml") +@WebAppConfiguration +public class PreAuthXmlTests { + @Autowired + FilterChainProxy filterChainProxy; + + @Test + public void configLoads() {} +}