use of org.springframework.security.web.util.matcher.RequestMatcher in project spring-boot by spring-projects.
the class EndpointRequestTests method excludeLinksShouldNotMatchBasePath.
@Test
void excludeLinksShouldNotMatchBasePath() {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint().excludingLinks();
assertMatcher(matcher).doesNotMatch("/actuator");
assertMatcher(matcher).matches("/actuator/foo");
assertMatcher(matcher).matches("/actuator/bar");
}
use of org.springframework.security.web.util.matcher.RequestMatcher in project spring-boot by spring-projects.
the class PathRequestTests method toH2ConsoleWhenManagementContextShouldNeverMatch.
@Test
void toH2ConsoleWhenManagementContextShouldNeverMatch() {
RequestMatcher matcher = PathRequest.toH2Console();
assertMatcher(matcher, "management").doesNotMatch("/h2-console");
assertMatcher(matcher, "management").doesNotMatch("/h2-console/subpath");
assertMatcher(matcher, "management").doesNotMatch("/js/file.js");
}
use of org.springframework.security.web.util.matcher.RequestMatcher in project spring-boot by spring-projects.
the class PathRequestTests method toH2ConsoleShouldMatchH2ConsolePath.
@Test
void toH2ConsoleShouldMatchH2ConsolePath() {
RequestMatcher matcher = PathRequest.toH2Console();
assertMatcher(matcher).matches("/h2-console");
assertMatcher(matcher).matches("/h2-console/subpath");
assertMatcher(matcher).doesNotMatch("/js/file.js");
}
use of org.springframework.security.web.util.matcher.RequestMatcher in project spring-boot by spring-projects.
the class StaticResourceRequestTests method atCommonLocationsWhenManagementContextShouldNeverMatch.
@Test
void atCommonLocationsWhenManagementContextShouldNeverMatch() {
RequestMatcher matcher = this.resourceRequest.atCommonLocations();
assertMatcher(matcher, "management").doesNotMatch("/css/file.css");
assertMatcher(matcher, "management").doesNotMatch("/js/file.js");
assertMatcher(matcher, "management").doesNotMatch("/images/file.css");
assertMatcher(matcher, "management").doesNotMatch("/webjars/file.css");
assertMatcher(matcher, "management").doesNotMatch("/foo/favicon.ico");
}
use of org.springframework.security.web.util.matcher.RequestMatcher in project spring-boot by spring-projects.
the class StaticResourceRequestTests method atLocationShouldMatchLocation.
@Test
void atLocationShouldMatchLocation() {
RequestMatcher matcher = this.resourceRequest.at(StaticResourceLocation.CSS);
assertMatcher(matcher).matches("/css/file.css");
assertMatcher(matcher).doesNotMatch("/js/file.js");
}
Aggregations