change AuthenticationProcessingFilter and SecurityEnforcementFilter to use Spring's WebApplicationContextUtils by defualt to find their config context.
This commit is contained in:
@@ -150,8 +150,7 @@ public class SecurityEnforcementFilterTests extends TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testStartupDetectsMissingAppContextLocation()
|
||||
throws Exception {
|
||||
public void testStartupDetectsMissingAppContext() throws Exception {
|
||||
MockFilterConfig config = new MockFilterConfig();
|
||||
config.setInitParmeter("loginFormUrl", "/login.jsp");
|
||||
|
||||
@@ -161,8 +160,7 @@ public class SecurityEnforcementFilterTests extends TestCase {
|
||||
filter.init(config);
|
||||
fail("Should have thrown ServletException");
|
||||
} catch (ServletException expected) {
|
||||
assertEquals("appContextLocation must be specified",
|
||||
expected.getMessage());
|
||||
assertTrue(expected.getMessage().startsWith("Error obtaining/creating ApplicationContext for config."));
|
||||
}
|
||||
|
||||
config.setInitParmeter("appContextLocation", "");
|
||||
@@ -171,8 +169,7 @@ public class SecurityEnforcementFilterTests extends TestCase {
|
||||
filter.init(config);
|
||||
fail("Should have thrown ServletException");
|
||||
} catch (ServletException expected) {
|
||||
assertEquals("appContextLocation must be specified",
|
||||
expected.getMessage());
|
||||
assertTrue(expected.getMessage().startsWith("Error obtaining/creating ApplicationContext for config."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -287,8 +287,7 @@ public class AuthenticationProcessingFilterTests extends TestCase {
|
||||
}
|
||||
}
|
||||
|
||||
public void testStartupDetectsMissingAppContextLocation()
|
||||
throws Exception {
|
||||
public void testStartupDetectsMissingAppContext() throws Exception {
|
||||
MockFilterConfig config = new MockFilterConfig();
|
||||
config.setInitParmeter("defaultTargetUrl", "/");
|
||||
config.setInitParmeter("authenticationFailureUrl", "/failed.jsp");
|
||||
@@ -299,8 +298,7 @@ public class AuthenticationProcessingFilterTests extends TestCase {
|
||||
filter.init(config);
|
||||
fail("Should have thrown ServletException");
|
||||
} catch (ServletException expected) {
|
||||
assertEquals("appContextLocation must be specified",
|
||||
expected.getMessage());
|
||||
assertTrue(expected.getMessage().startsWith("Error obtaining/creating ApplicationContext for config."));
|
||||
}
|
||||
|
||||
config.setInitParmeter("appContextLocation", "");
|
||||
@@ -309,8 +307,7 @@ public class AuthenticationProcessingFilterTests extends TestCase {
|
||||
filter.init(config);
|
||||
fail("Should have thrown ServletException");
|
||||
} catch (ServletException expected) {
|
||||
assertEquals("appContextLocation must be specified",
|
||||
expected.getMessage());
|
||||
assertTrue(expected.getMessage().startsWith("Error obtaining/creating ApplicationContext for config."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user