|
|
@ -28,6 +28,7 @@ import org.springframework.boot.actuate.endpoint.Operation;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
|
|
|
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
|
|
|
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint;
|
|
|
|
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoint;
|
|
|
|
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
|
|
|
|
import org.springframework.boot.actuate.endpoint.web.PathMappedEndpoints;
|
|
|
|
|
|
|
|
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpoint;
|
|
|
|
import org.springframework.context.support.StaticApplicationContext;
|
|
|
|
import org.springframework.context.support.StaticApplicationContext;
|
|
|
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
|
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
|
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
|
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
|
@ -117,8 +118,14 @@ public class EndpointRequestTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
public void excludeByClassShouldNotMatchExcluded() {
|
|
|
|
public void excludeByClassShouldNotMatchExcluded() {
|
|
|
|
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint()
|
|
|
|
ServerWebExchangeMatcher matcher = EndpointRequest.toAnyEndpoint()
|
|
|
|
.excluding(FooEndpoint.class);
|
|
|
|
.excluding(FooEndpoint.class, BazServletEndpoint.class);
|
|
|
|
assertMatcher(matcher).doesNotMatch("/actuator/foo");
|
|
|
|
List<ExposableEndpoint<?>> endpoints = new ArrayList<>();
|
|
|
|
|
|
|
|
endpoints.add(mockEndpoint("foo", "foo"));
|
|
|
|
|
|
|
|
endpoints.add(mockEndpoint("bar", "bar"));
|
|
|
|
|
|
|
|
endpoints.add(mockEndpoint("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/bar");
|
|
|
|
assertMatcher(matcher).matches("/actuator");
|
|
|
|
assertMatcher(matcher).matches("/actuator");
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -280,6 +287,11 @@ public class EndpointRequestTests {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ServletEndpoint(id = "baz")
|
|
|
|
|
|
|
|
private static class BazServletEndpoint {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
interface TestEndpoint extends ExposableEndpoint<Operation>, PathMappedEndpoint {
|
|
|
|
interface TestEndpoint extends ExposableEndpoint<Operation>, PathMappedEndpoint {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|