Do not link to controller endpoints in Jersey-based Actuator
Closes gh-12463
This commit is contained in:
@@ -62,13 +62,11 @@ class JerseyWebEndpointManagementContextConfiguration {
|
||||
public ResourceConfigCustomizer webEndpointRegistrar(
|
||||
WebEndpointsSupplier webEndpointsSupplier,
|
||||
ServletEndpointsSupplier servletEndpointsSupplier,
|
||||
ControllerEndpointsSupplier controllerEndpointsSupplier,
|
||||
EndpointMediaTypes endpointMediaTypes,
|
||||
WebEndpointProperties webEndpointProperties) {
|
||||
List<ExposableEndpoint<?>> allEndpoints = new ArrayList<>();
|
||||
allEndpoints.addAll(webEndpointsSupplier.getEndpoints());
|
||||
allEndpoints.addAll(servletEndpointsSupplier.getEndpoints());
|
||||
allEndpoints.addAll(controllerEndpointsSupplier.getEndpoints());
|
||||
return (resourceConfig) -> {
|
||||
JerseyEndpointResourceFactory resourceFactory = new JerseyEndpointResourceFactory();
|
||||
String basePath = webEndpointProperties.getBasePath();
|
||||
|
||||
@@ -65,8 +65,8 @@ public class JerseyEndpointIntegrationTests {
|
||||
.baseUrl("http://localhost:" + port).build();
|
||||
client.get().uri("/actuator").exchange().expectStatus().isOk()
|
||||
.expectBody().jsonPath("_links.beans").isNotEmpty()
|
||||
.jsonPath("_links.restcontroller").isNotEmpty()
|
||||
.jsonPath("_links.controller").isNotEmpty();
|
||||
.jsonPath("_links.restcontroller").doesNotExist()
|
||||
.jsonPath("_links.controller").doesNotExist();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user