AntPathRequestMatcher implements RequestVariableExtractor

Issue gh-3964
This commit is contained in:
Rob Winch
2016-07-05 08:26:15 -05:00
parent e4c13e3c0e
commit 9d50944cb2
5 changed files with 19 additions and 66 deletions

View File

@@ -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;
}
}
}

View File

@@ -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);