use of org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher in project spring-boot by spring-projects.
the class EndpointRequestTests method toAnyEndpointWhenBasePathIsEmptyShouldNotMatchLinks.
@Test
void toAnyEndpointWhenBasePathIsEmptyShouldNotMatchLinks() {
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint();
RequestMatcherAssert assertMatcher = assertMatcher(matcher, "");
assertMatcher.doesNotMatch("/");
assertMatcher.matches("/foo");
assertMatcher.matches("/bar");
}
use of org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher in project spring-boot by spring-projects.
the class EndpointRequestTests method excludeByIdShouldNotMatchExcluded.
@Test
void excludeByIdShouldNotMatchExcluded() {
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint().excluding("foo");
assertMatcher(matcher).doesNotMatch("/actuator/foo");
assertMatcher(matcher).matches("/actuator/bar");
assertMatcher(matcher).matches("/actuator");
}
use of org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher in project spring-boot by spring-projects.
the class EndpointRequestTests method toEndpointIdShouldNotMatchOtherPath.
@Test
void toEndpointIdShouldNotMatchOtherPath() {
ServerWebExchangeMatcher matcher = EndpointRequest.to("foo");
assertMatcher(matcher).doesNotMatch("/actuator/bar");
}
use of org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher in project spring-boot by spring-projects.
the class EndpointRequestTests method excludeByClassShouldNotMatchLinksIfExcluded.
@Test
void excludeByClassShouldNotMatchLinksIfExcluded() {
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint().excludingLinks().excluding(FooEndpoint.class);
assertMatcher(matcher).doesNotMatch("/actuator/foo");
assertMatcher(matcher).doesNotMatch("/actuator");
}
use of org.springframework.security.web.server.util.matcher.ServerWebExchangeMatcher in project spring-boot by spring-projects.
the class StaticResourceRequestTests method atCommonLocationsShouldMatchCommonLocations.
@Test
void atCommonLocationsShouldMatchCommonLocations() {
ServerWebExchangeMatcher matcher = this.resourceRequest.atCommonLocations();
assertMatcher(matcher).matches("/css/file.css");
assertMatcher(matcher).matches("/js/file.js");
assertMatcher(matcher).matches("/images/file.css");
assertMatcher(matcher).matches("/webjars/file.css");
assertMatcher(matcher).matches("/favicon.ico");
assertMatcher(matcher).matches("/favicon.png");
assertMatcher(matcher).matches("/icons/icon-48x48.png");
assertMatcher(matcher).doesNotMatch("/bar");
}
Aggregations