use of org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints in project spring-boot by spring-projects.
the class EndpointRequestTests method noEndpointPathsBeansShouldNeverMatch.
@Test
void noEndpointPathsBeansShouldNeverMatch() {
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint();
assertMatcher(matcher, (PathMappedEndpoints) null).doesNotMatch("/actuator/foo");
assertMatcher(matcher, (PathMappedEndpoints) null).doesNotMatch("/actuator/bar");
}
use of org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints in project spring-boot by spring-projects.
the class EndpointRequestTests method noEndpointPathsBeansShouldNeverMatch.
@Test
void noEndpointPathsBeansShouldNeverMatch() {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint();
assertMatcher(matcher, (PathMappedEndpoints) null).doesNotMatch("/actuator/foo");
assertMatcher(matcher, (PathMappedEndpoints) null).doesNotMatch("/actuator/bar");
}
use of org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints in project spring-boot by spring-projects.
the class EndpointRequestTests method excludeByClassShouldNotMatchExcluded.
@Test
void excludeByClassShouldNotMatchExcluded() {
RequestMatcher matcher = EndpointRequest.toAnyEndpoint().excluding(FooEndpoint.class, BazServletEndpoint.class);
List<ExposableEndpoint<?>> endpoints = new ArrayList<>();
endpoints.add(mockEndpoint(EndpointId.of("foo"), "foo"));
endpoints.add(mockEndpoint(EndpointId.of("bar"), "bar"));
endpoints.add(mockEndpoint(EndpointId.of("baz"), "baz"));
PathMappedEndpoints pathMappedEndpoints = new PathMappedEndpoints("/actuator", () -> endpoints);
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/foo");
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/baz");
assertMatcher(matcher).matches("/actuator/bar");
assertMatcher(matcher).matches("/actuator");
}
use of org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints in project spring-boot by spring-projects.
the class EndpointRequestTests method excludeByClassShouldNotMatchExcluded.
@Test
void excludeByClassShouldNotMatchExcluded() {
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint().excluding(FooEndpoint.class, BazServletEndpoint.class);
List<ExposableEndpoint<?>> endpoints = new ArrayList<>();
endpoints.add(mockEndpoint(EndpointId.of("foo"), "foo"));
endpoints.add(mockEndpoint(EndpointId.of("bar"), "bar"));
endpoints.add(mockEndpoint(EndpointId.of("baz"), "baz"));
PathMappedEndpoints pathMappedEndpoints = new PathMappedEndpoints("/actuator", () -> endpoints);
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/foo");
assertMatcher(matcher, pathMappedEndpoints).doesNotMatch("/actuator/baz");
assertMatcher(matcher).matches("/actuator/bar");
assertMatcher(matcher).matches("/actuator");
}
Aggregations