Fix parameter order for RequestMatcherAssert.doesNotMatch()
Closes gh-13707
This commit is contained in:
parent
63ae682a95
commit
b87b23a44f
|
@ -78,14 +78,15 @@ public class EndpointRequestTests {
|
||||||
@Test
|
@Test
|
||||||
public void toAnyEndpointWhenServletPathNotEmptyShouldMatch() {
|
public void toAnyEndpointWhenServletPathNotEmptyShouldMatch() {
|
||||||
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
|
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
|
||||||
assertMatcher(matcher, "/actuator", "/spring", "/admin").matches("/actuator/foo",
|
assertMatcher(matcher, "/actuator", "/spring", "/admin")
|
||||||
"/spring", "/admin");
|
.matches(Arrays.asList("/spring", "/admin"), "/actuator/foo");
|
||||||
assertMatcher(matcher, "/actuator", "/spring", "/admin").matches("/actuator/bar",
|
assertMatcher(matcher, "/actuator", "/spring", "/admin")
|
||||||
"/spring", "/admin");
|
.matches(Arrays.asList("/spring", "/admin"), "/actuator/bar");
|
||||||
assertMatcher(matcher, "/actuator", "/spring").matches("/actuator", "/spring");
|
assertMatcher(matcher, "/actuator", "/spring").matches(Arrays.asList("/spring"),
|
||||||
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/actuator/baz",
|
"/actuator");
|
||||||
"/spring");
|
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/spring",
|
||||||
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("/actuator/foo", "");
|
"/actuator/baz");
|
||||||
|
assertMatcher(matcher, "/actuator", "/spring").doesNotMatch("", "/actuator/foo");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -279,8 +280,8 @@ public class EndpointRequestTests {
|
||||||
matches(mockRequest(servletPath));
|
matches(mockRequest(servletPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void matches(String pathInfo, String... servletPaths) {
|
public void matches(List<String> servletPaths, String pathInfo) {
|
||||||
Arrays.stream(servletPaths).forEach((p) -> matches(mockRequest(p, pathInfo)));
|
servletPaths.forEach((p) -> matches(mockRequest(p, pathInfo)));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void matches(HttpServletRequest request) {
|
private void matches(HttpServletRequest request) {
|
||||||
|
|
Loading…
Reference in New Issue