Refactor AbstractFilterInvocationDefinitionSource to use a standard URL String in its lookup method, rather than a full FilterInvocation. This will make it easier for views (taglibs etc) to access URI security details without needing to construct a MockFilterInvocation.
This commit is contained in:
@@ -81,8 +81,7 @@ public class MockFilterInvocationDefinitionSource
|
||||
}
|
||||
}
|
||||
|
||||
protected ConfigAttributeDefinition lookupAttributes(
|
||||
FilterInvocation filterInvocation) {
|
||||
public ConfigAttributeDefinition lookupAttributes(String url) {
|
||||
throw new UnsupportedOperationException("mock method not implemented");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,8 @@ public class PathBasedFilterDefinitionMapTests extends TestCase {
|
||||
FilterInvocation fi = new FilterInvocation(req,
|
||||
new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi);
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi
|
||||
.getRequestUrl());
|
||||
assertEquals(def, response);
|
||||
}
|
||||
|
||||
@@ -98,7 +99,8 @@ public class PathBasedFilterDefinitionMapTests extends TestCase {
|
||||
FilterInvocation fi = new FilterInvocation(req,
|
||||
new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi);
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi
|
||||
.getRequestUrl());
|
||||
assertEquals(null, response);
|
||||
}
|
||||
|
||||
@@ -117,7 +119,8 @@ public class PathBasedFilterDefinitionMapTests extends TestCase {
|
||||
FilterInvocation fi = new FilterInvocation(req,
|
||||
new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi);
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi
|
||||
.getRequestUrl());
|
||||
assertEquals(def, response);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,8 @@ public class RegExpBasedFilterDefinitionMapTests extends TestCase {
|
||||
FilterInvocation fi = new FilterInvocation(req,
|
||||
new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi);
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi
|
||||
.getRequestUrl());
|
||||
assertEquals(def, response);
|
||||
}
|
||||
|
||||
@@ -98,7 +99,8 @@ public class RegExpBasedFilterDefinitionMapTests extends TestCase {
|
||||
FilterInvocation fi = new FilterInvocation(req,
|
||||
new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi);
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi
|
||||
.getRequestUrl());
|
||||
assertEquals(null, response);
|
||||
}
|
||||
|
||||
@@ -117,7 +119,8 @@ public class RegExpBasedFilterDefinitionMapTests extends TestCase {
|
||||
FilterInvocation fi = new FilterInvocation(req,
|
||||
new MockHttpServletResponse(), new MockFilterChain());
|
||||
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi);
|
||||
ConfigAttributeDefinition response = map.lookupAttributes(fi
|
||||
.getRequestUrl());
|
||||
assertEquals(def, response);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user