AntPathRequestMatcher implements RequestVariableExtractor
Issue gh-3964
This commit is contained in:
@@ -65,13 +65,6 @@ public class AbstractVariableEvaluationContextPostProcessorTests {
|
||||
assertThat(this.context.lookupVariable(KEY)).isEqualTo(VALUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void postProcessVariableName() {
|
||||
this.context = this.processor.postProcess(this.context, this.invocation);
|
||||
|
||||
assertThat(this.context.lookupVariable("nothing")).isEqualTo(VALUE);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void extractVariablesOnlyUsedOnce() {
|
||||
this.context = this.processor.postProcess(this.context, this.invocation);
|
||||
@@ -89,10 +82,5 @@ public class AbstractVariableEvaluationContextPostProcessorTests {
|
||||
protected Map<String, String> extractVariables(HttpServletRequest request) {
|
||||
return this.results;
|
||||
}
|
||||
|
||||
@Override
|
||||
String postProcessVariableName(String variableName) {
|
||||
return KEY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -210,21 +210,6 @@ public class AntPathRequestMatcherTests {
|
||||
assertThat(matcher.matches(request)).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void postProcessVariableNameCaseInsensitive() {
|
||||
AntPathRequestMatcher matcher = new AntPathRequestMatcher("/**", null, false);
|
||||
String variableName = "userName";
|
||||
assertThat(matcher.postProcessVariableName(variableName))
|
||||
.isEqualTo(variableName.toLowerCase());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void postProcessVariableNameCaseSensitive() {
|
||||
AntPathRequestMatcher matcher = new AntPathRequestMatcher("/**", null, true);
|
||||
String variableName = "userName";
|
||||
assertThat(matcher.postProcessVariableName(variableName)).isEqualTo(variableName);
|
||||
}
|
||||
|
||||
private HttpServletRequest createRequestWithNullMethod(String path) {
|
||||
when(this.request.getQueryString()).thenReturn("doesntMatter");
|
||||
when(this.request.getServletPath()).thenReturn(path);
|
||||
|
||||
Reference in New Issue
Block a user