Browse Source

Deprecate framework-specific @*Endpoint annotations

Prior to this commit, applications could declare Actuator Endpoints
using web framework-specific annotations, such as `@ServletEndpoint`,
@ControllerEndpoint and @RestControllerEndpoint.

Such annotations are closely tied to the programming model of specific
web technologies, such as Servlet or Spring MVC. Unlike other
`@Endpoint` support, they are not portable and will not work
transparently over blocking/reactive and transports.

Because of the strong adherence of this support with the underlying
infrastructure, it makes it impossible to evolve the implementation of
Actuator support without breaking this use case. The reference
documentation has been advocating for using `@Endpoint` and
`@*Operation` for custom endpoints for a long time now.

This commit deprecates this specific support in favor of the recommended
approach.

Closes gh-31768
pull/40357/head
Brian Clozel 2 years ago
parent
commit
647a5ec6be
  1. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java
  2. 5
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java
  3. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java
  4. 4
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointManagementContextConfiguration.java
  5. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.java
  6. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java
  7. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java
  8. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java
  9. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java
  10. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointIntegrationTests.java
  11. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointIntegrationTests.java
  12. 2
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java
  13. 3
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java
  14. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java
  15. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java
  16. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java
  17. 1
      spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java
  18. 4
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java
  19. 5
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ExposableServletEndpoint.java
  20. 5
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java
  21. 4
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java
  22. 8
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java
  23. 3
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointFilter.java
  24. 3
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredServletEndpoint.java
  25. 4
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java
  26. 4
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpoint.java
  27. 8
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscoverer.java
  28. 3
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointFilter.java
  29. 5
      spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointsSupplier.java
  30. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolverTests.java
  31. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java
  32. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java
  33. 5
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java
  34. 5
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java
  35. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java
  36. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java
  37. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java
  38. 1
      spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java
  39. 2
      spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc
  40. 20
      spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc
  41. 1
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/ExampleRestControllerEndpoint.java
  42. 1
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplication.java
  43. 1
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/java/smoketest/actuator/SampleRestControllerEndpointWithException.java
  44. 2
      spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/src/main/java/smoketest/secure/jersey/SampleSecureJerseyApplication.java

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/cloudfoundry/servlet/CloudFoundryActuatorAutoConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -111,6 +111,7 @@ public class CloudFoundryActuatorAutoConfiguration { @@ -111,6 +111,7 @@ public class CloudFoundryActuatorAutoConfiguration {
}
@Bean
@SuppressWarnings("removal")
public CloudFoundryWebEndpointServletHandlerMapping cloudFoundryWebEndpointServletHandlerMapping(
ParameterValueMapper parameterMapper, EndpointMediaTypes endpointMediaTypes,
RestTemplateBuilder restTemplateBuilder, ServletEndpointsSupplier servletEndpointsSupplier,

5
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -47,6 +47,7 @@ import org.springframework.web.servlet.DispatcherServlet; @@ -47,6 +47,7 @@ import org.springframework.web.servlet.DispatcherServlet;
public class ServletEndpointManagementContextConfiguration {
@Bean
@SuppressWarnings("removal")
public IncludeExcludeEndpointFilter<ExposableServletEndpoint> servletExposeExcludePropertyEndpointFilter(
WebEndpointProperties properties) {
WebEndpointProperties.Exposure exposure = properties.getExposure();
@ -56,6 +57,7 @@ public class ServletEndpointManagementContextConfiguration { @@ -56,6 +57,7 @@ public class ServletEndpointManagementContextConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(DispatcherServlet.class)
@SuppressWarnings("removal")
public static class WebMvcServletEndpointManagementContextConfiguration {
@Bean
@ -70,6 +72,7 @@ public class ServletEndpointManagementContextConfiguration { @@ -70,6 +72,7 @@ public class ServletEndpointManagementContextConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnClass(ResourceConfig.class)
@ConditionalOnMissingClass("org.springframework.web.servlet.DispatcherServlet")
@SuppressWarnings("removal")
public static class JerseyServletEndpointManagementContextConfiguration {
@Bean

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -96,6 +96,7 @@ public class WebEndpointAutoConfiguration { @@ -96,6 +96,7 @@ public class WebEndpointAutoConfiguration {
@Bean
@ConditionalOnMissingBean(ControllerEndpointsSupplier.class)
@SuppressWarnings("removal")
public ControllerEndpointDiscoverer controllerEndpointDiscoverer(ObjectProvider<PathMapper> endpointPathMappers,
ObjectProvider<Collection<EndpointFilter<ExposableControllerEndpoint>>> filters) {
return new ControllerEndpointDiscoverer(this.applicationContext, endpointPathMappers.orderedStream().toList(),
@ -124,6 +125,7 @@ public class WebEndpointAutoConfiguration { @@ -124,6 +125,7 @@ public class WebEndpointAutoConfiguration {
@Configuration(proxyBeanMethods = false)
@ConditionalOnWebApplication(type = Type.SERVLET)
@SuppressWarnings("removal")
static class WebEndpointServletConfiguration {
@Bean

4
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/jersey/JerseyWebEndpointManagementContextConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -84,6 +84,7 @@ class JerseyWebEndpointManagementContextConfiguration { @@ -84,6 +84,7 @@ class JerseyWebEndpointManagementContextConfiguration {
private static final EndpointId HEALTH_ENDPOINT_ID = EndpointId.of("health");
@Bean
@SuppressWarnings("removal")
JerseyWebEndpointsResourcesRegistrar jerseyWebEndpointsResourcesRegistrar(Environment environment,
WebEndpointsSupplier webEndpointsSupplier, ServletEndpointsSupplier servletEndpointsSupplier,
EndpointMediaTypes endpointMediaTypes, WebEndpointProperties webEndpointProperties) {
@ -124,6 +125,7 @@ class JerseyWebEndpointManagementContextConfiguration { @@ -124,6 +125,7 @@ class JerseyWebEndpointManagementContextConfiguration {
/**
* Register endpoints with the {@link ResourceConfig} for the management context.
*/
@SuppressWarnings("removal")
static class JerseyWebEndpointsResourcesRegistrar implements ManagementContextResourceConfigCustomizer {
private final WebEndpointsSupplier webEndpointsSupplier;

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/servlet/WebMvcEndpointManagementContextConfiguration.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -82,6 +82,7 @@ public class WebMvcEndpointManagementContextConfiguration { @@ -82,6 +82,7 @@ public class WebMvcEndpointManagementContextConfiguration {
@Bean
@ConditionalOnMissingBean
@SuppressWarnings("removal")
public WebMvcEndpointHandlerMapping webEndpointServletHandlerMapping(WebEndpointsSupplier webEndpointsSupplier,
ServletEndpointsSupplier servletEndpointsSupplier, ControllerEndpointsSupplier controllerEndpointsSupplier,
EndpointMediaTypes endpointMediaTypes, CorsEndpointProperties corsProperties,

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfigurationTests.java

@ -42,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat; @@ -42,6 +42,7 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Phillip Webb
* @author Madhura Bhave
*/
@SuppressWarnings("removal")
class ServletEndpointManagementContextConfigurationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/endpoint/web/WebEndpointAutoConfigurationTests.java

@ -95,6 +95,7 @@ class WebEndpointAutoConfigurationTests { @@ -95,6 +95,7 @@ class WebEndpointAutoConfigurationTests {
}
@Test
@SuppressWarnings("removal")
void webApplicationConfiguresEndpointDiscoverer() {
this.contextRunner.run((context) -> {
assertThat(context).hasSingleBean(ControllerEndpointDiscoverer.class);
@ -109,11 +110,13 @@ class WebEndpointAutoConfigurationTests { @@ -109,11 +110,13 @@ class WebEndpointAutoConfigurationTests {
}
@Test
@SuppressWarnings("removal")
void contextShouldConfigureServletEndpointDiscoverer() {
this.contextRunner.run((context) -> assertThat(context).hasSingleBean(ServletEndpointDiscoverer.class));
}
@Test
@SuppressWarnings("removal")
void contextWhenNotServletShouldNotConfigureServletEndpointDiscoverer() {
new ApplicationContextRunner().withConfiguration(CONFIGURATIONS)
.run((context) -> assertThat(context).doesNotHaveBean(ServletEndpointDiscoverer.class));

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebFluxIntegrationTests.java

@ -45,6 +45,7 @@ import org.springframework.web.bind.annotation.GetMapping; @@ -45,6 +45,7 @@ import org.springframework.web.bind.annotation.GetMapping;
*
* @author Phillip Webb
*/
@SuppressWarnings("removal")
class ControllerEndpointWebFluxIntegrationTests {
private AnnotationConfigReactiveWebApplicationContext context;

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/ControllerEndpointWebMvcIntegrationTests.java

@ -121,6 +121,7 @@ class ControllerEndpointWebMvcIntegrationTests { @@ -121,6 +121,7 @@ class ControllerEndpointWebMvcIntegrationTests {
}
@RestControllerEndpoint(id = "example")
@SuppressWarnings("removal")
static class ExampleController {
@GetMapping("/")

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/JerseyEndpointIntegrationTests.java

@ -161,11 +161,13 @@ class JerseyEndpointIntegrationTests { @@ -161,11 +161,13 @@ class JerseyEndpointIntegrationTests {
}
@ControllerEndpoint(id = "controller")
@SuppressWarnings("removal")
static class TestControllerEndpoint {
}
@RestControllerEndpoint(id = "restcontroller")
@SuppressWarnings("removal")
static class TestRestControllerEndpoint {
}

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointIntegrationTests.java

@ -108,11 +108,13 @@ class WebFluxEndpointIntegrationTests { @@ -108,11 +108,13 @@ class WebFluxEndpointIntegrationTests {
}
@ControllerEndpoint(id = "controller")
@SuppressWarnings("removal")
static class TestControllerEndpoint {
}
@RestControllerEndpoint(id = "restcontroller")
@SuppressWarnings("removal")
static class TestRestControllerEndpoint {
}

2
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointExposureIntegrationTests.java

@ -190,6 +190,7 @@ class WebMvcEndpointExposureIntegrationTests { @@ -190,6 +190,7 @@ class WebMvcEndpointExposureIntegrationTests {
}
@RestControllerEndpoint(id = "custommvc")
@SuppressWarnings("removal")
static class CustomMvcEndpoint {
@GetMapping("/")
@ -200,6 +201,7 @@ class WebMvcEndpointExposureIntegrationTests { @@ -200,6 +201,7 @@ class WebMvcEndpointExposureIntegrationTests {
}
@ServletEndpoint(id = "customservlet")
@SuppressWarnings("removal")
static class CustomServletEndpoint implements Supplier<EndpointServlet> {
@Override

3
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebMvcEndpointIntegrationTests.java

@ -198,6 +198,7 @@ class WebMvcEndpointIntegrationTests { @@ -198,6 +198,7 @@ class WebMvcEndpointIntegrationTests {
}
@ServletEndpoint(id = "servlet")
@SuppressWarnings("removal")
static class TestServletEndpoint implements Supplier<EndpointServlet> {
@Override
@ -209,11 +210,13 @@ class WebMvcEndpointIntegrationTests { @@ -209,11 +210,13 @@ class WebMvcEndpointIntegrationTests {
}
@ControllerEndpoint(id = "controller")
@SuppressWarnings("removal")
static class TestControllerEndpoint {
}
@RestControllerEndpoint(id = "restcontroller")
@SuppressWarnings("removal")
static class TestRestControllerEndpoint {
}

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/reactive/EndpointRequestTests.java

@ -355,6 +355,7 @@ class EndpointRequestTests { @@ -355,6 +355,7 @@ class EndpointRequestTests {
}
@ServletEndpoint(id = "baz")
@SuppressWarnings("removal")
static class BazServletEndpoint {
}

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/AbstractEndpointRequestIntegrationTests.java

@ -178,6 +178,7 @@ abstract class AbstractEndpointRequestIntegrationTests { @@ -178,6 +178,7 @@ abstract class AbstractEndpointRequestIntegrationTests {
}
@ServletEndpoint(id = "se1")
@SuppressWarnings("removal")
static class TestServletEndpoint implements Supplier<EndpointServlet> {
@Override

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/security/servlet/EndpointRequestTests.java

@ -354,6 +354,7 @@ class EndpointRequestTests { @@ -354,6 +354,7 @@ class EndpointRequestTests {
}
@ServletEndpoint(id = "baz")
@SuppressWarnings("removal")
static class BazServletEndpoint {
}

1
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/web/servlet/WebMvcEndpointChildContextConfigurationIntegrationTests.java

@ -217,6 +217,7 @@ class WebMvcEndpointChildContextConfigurationIntegrationTests { @@ -217,6 +217,7 @@ class WebMvcEndpointChildContextConfigurationIntegrationTests {
}
@RestControllerEndpoint(id = "failController")
@SuppressWarnings("removal")
static class FailingControllerEndpoint {
@GetMapping

4
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/EndpointServlet.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,7 +33,9 @@ import org.springframework.util.StringUtils; @@ -33,7 +33,9 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb
* @author Julio José Gómez Díaz
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@Deprecated(since = "3.3.0", forRemoval = true)
public final class EndpointServlet {
private final Servlet servlet;

5
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ExposableServletEndpoint.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,7 +24,10 @@ import org.springframework.boot.actuate.endpoint.Operation; @@ -24,7 +24,10 @@ import org.springframework.boot.actuate.endpoint.Operation;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@Deprecated(since = "3.3.0", forRemoval = true)
@SuppressWarnings("removal")
public interface ExposableServletEndpoint extends ExposableEndpoint<Operation>, PathMappedEndpoint {
/**

5
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrar.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,7 +35,10 @@ import org.springframework.util.StringUtils; @@ -35,7 +35,10 @@ import org.springframework.util.StringUtils;
* @author Phillip Webb
* @author Madhura Bhave
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@Deprecated(since = "3.3.0", forRemoval = true)
@SuppressWarnings("removal")
public class ServletEndpointRegistrar implements ServletContextInitializer {
private static final Log logger = LogFactory.getLog(ServletEndpointRegistrar.class);

4
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpoint.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -47,12 +47,14 @@ import org.springframework.web.bind.annotation.PostMapping; @@ -47,12 +47,14 @@ import org.springframework.web.bind.annotation.PostMapping;
* @since 2.0.0
* @see WebEndpoint
* @see RestControllerEndpoint
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Endpoint
@FilteredEndpoint(ControllerEndpointFilter.class)
@Deprecated(since = "3.3.0", forRemoval = true)
public @interface ControllerEndpoint {
/**

8
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscoverer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2023 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -31,7 +31,6 @@ import org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer; @@ -31,7 +31,6 @@ import org.springframework.boot.actuate.endpoint.annotation.EndpointDiscoverer;
import org.springframework.boot.actuate.endpoint.invoke.OperationInvoker;
import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper;
import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer.ControllerEndpointDiscovererRuntimeHints;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ImportRuntimeHints;
import org.springframework.core.annotation.MergedAnnotations;
@ -43,8 +42,11 @@ import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; @@ -43,8 +42,11 @@ import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@ImportRuntimeHints(ControllerEndpointDiscovererRuntimeHints.class)
@ImportRuntimeHints(ControllerEndpointDiscoverer.ControllerEndpointDiscovererRuntimeHints.class)
@Deprecated(since = "3.3.0", forRemoval = true)
@SuppressWarnings("removal")
public class ControllerEndpointDiscoverer extends EndpointDiscoverer<ExposableControllerEndpoint, Operation>
implements ControllerEndpointsSupplier {

3
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointFilter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -25,6 +25,7 @@ import org.springframework.boot.actuate.endpoint.annotation.DiscovererEndpointFi @@ -25,6 +25,7 @@ import org.springframework.boot.actuate.endpoint.annotation.DiscovererEndpointFi
*
* @author Phillip Webb
*/
@SuppressWarnings("removal")
class ControllerEndpointFilter extends DiscovererEndpointFilter {
ControllerEndpointFilter() {

3
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/DiscoveredServletEndpoint.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,6 +32,7 @@ import org.springframework.util.Assert; @@ -32,6 +32,7 @@ import org.springframework.util.Assert;
*
* @author Phillip Webb
*/
@SuppressWarnings("removal")
class DiscoveredServletEndpoint extends AbstractDiscoveredEndpoint<Operation> implements ExposableServletEndpoint {
private final String rootPath;

4
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/RestControllerEndpoint.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2021 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -48,6 +48,7 @@ import org.springframework.web.bind.annotation.ResponseBody; @@ -48,6 +48,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
* @since 2.0.0
* @see WebEndpoint
* @see ControllerEndpoint
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@ -55,6 +56,7 @@ import org.springframework.web.bind.annotation.ResponseBody; @@ -55,6 +56,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Endpoint
@FilteredEndpoint(ControllerEndpointFilter.class)
@ResponseBody
@Deprecated(since = "3.3.0", forRemoval = true)
public @interface RestControllerEndpoint {
/**

4
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpoint.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -40,12 +40,14 @@ import org.springframework.core.annotation.AliasFor; @@ -40,12 +40,14 @@ import org.springframework.core.annotation.AliasFor;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Endpoint
@FilteredEndpoint(ServletEndpointFilter.class)
@Deprecated(since = "3.3.0", forRemoval = true)
public @interface ServletEndpoint {
/**

8
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscoverer.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2022 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -32,7 +32,6 @@ import org.springframework.boot.actuate.endpoint.invoke.OperationInvoker; @@ -32,7 +32,6 @@ import org.springframework.boot.actuate.endpoint.invoke.OperationInvoker;
import org.springframework.boot.actuate.endpoint.invoke.ParameterValueMapper;
import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint;
import org.springframework.boot.actuate.endpoint.web.PathMapper;
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.ServletEndpointDiscovererRuntimeHints;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.ImportRuntimeHints;
import org.springframework.core.annotation.MergedAnnotations;
@ -43,8 +42,11 @@ import org.springframework.core.annotation.MergedAnnotations.SearchStrategy; @@ -43,8 +42,11 @@ import org.springframework.core.annotation.MergedAnnotations.SearchStrategy;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@ImportRuntimeHints(ServletEndpointDiscovererRuntimeHints.class)
@ImportRuntimeHints(ServletEndpointDiscoverer.ServletEndpointDiscovererRuntimeHints.class)
@Deprecated(since = "3.3.0", forRemoval = true)
@SuppressWarnings("removal")
public class ServletEndpointDiscoverer extends EndpointDiscoverer<ExposableServletEndpoint, Operation>
implements ServletEndpointsSupplier {

3
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointFilter.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.annotation.DiscovererEndpointFi @@ -24,6 +24,7 @@ import org.springframework.boot.actuate.endpoint.annotation.DiscovererEndpointFi
*
* @author Phillip Webb
*/
@SuppressWarnings("removal")
class ServletEndpointFilter extends DiscovererEndpointFilter {
ServletEndpointFilter() {

5
spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointsSupplier.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2012-2019 the original author or authors.
* Copyright 2012-2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -24,8 +24,11 @@ import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint; @@ -24,8 +24,11 @@ import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.0 in favor of {@code @Endpoint} and {@code @WebEndpoint}
*/
@FunctionalInterface
@Deprecated(since = "3.3.0", forRemoval = true)
@SuppressWarnings("removal")
public interface ServletEndpointsSupplier extends EndpointsSupplier<ExposableServletEndpoint> {
}

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointLinksResolverTests.java

@ -75,6 +75,7 @@ class EndpointLinksResolverTests { @@ -75,6 +75,7 @@ class EndpointLinksResolverTests {
}
@Test
@SuppressWarnings("removal")
void resolvedLinksContainsALinkForServletEndpoint() {
ExposableServletEndpoint servletEndpoint = mock(ExposableServletEndpoint.class);
given(servletEndpoint.getEndpointId()).willReturn(EndpointId.of("alpha"));

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/EndpointServletTests.java

@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.entry; @@ -36,6 +36,7 @@ import static org.assertj.core.api.Assertions.entry;
* @author Phillip Webb
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
class EndpointServletTests {
@Test

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/ServletEndpointRegistrarTests.java

@ -48,6 +48,7 @@ import static org.mockito.Mockito.mock; @@ -48,6 +48,7 @@ import static org.mockito.Mockito.mock;
* @author Stephane Nicoll
*/
@ExtendWith(MockitoExtension.class)
@SuppressWarnings("removal")
class ServletEndpointRegistrarTests {
@Mock

5
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ControllerEndpointDiscovererTests.java

@ -30,7 +30,6 @@ import org.springframework.boot.actuate.endpoint.EndpointId; @@ -30,7 +30,6 @@ import org.springframework.boot.actuate.endpoint.EndpointId;
import org.springframework.boot.actuate.endpoint.annotation.DiscoveredEndpoint;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointDiscoverer.ControllerEndpointDiscovererRuntimeHints;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
@ -50,6 +49,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; @@ -50,6 +49,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Stephane Nicoll
* @author Moritz Halbritter
*/
@SuppressWarnings("removal")
class ControllerEndpointDiscovererTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner();
@ -132,7 +132,8 @@ class ControllerEndpointDiscovererTests { @@ -132,7 +132,8 @@ class ControllerEndpointDiscovererTests {
@Test
void shouldRegisterHints() {
RuntimeHints runtimeHints = new RuntimeHints();
new ControllerEndpointDiscovererRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
new ControllerEndpointDiscoverer.ControllerEndpointDiscovererRuntimeHints().registerHints(runtimeHints,
getClass().getClassLoader());
assertThat(RuntimeHintsPredicates.reflection()
.onType(ControllerEndpointFilter.class)
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);

5
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/annotation/ServletEndpointDiscovererTests.java

@ -38,7 +38,6 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint; @@ -38,7 +38,6 @@ import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.boot.actuate.endpoint.web.EndpointServlet;
import org.springframework.boot.actuate.endpoint.web.ExposableServletEndpoint;
import org.springframework.boot.actuate.endpoint.web.annotation.ServletEndpointDiscoverer.ServletEndpointDiscovererRuntimeHints;
import org.springframework.boot.autoconfigure.AutoConfigurations;
import org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration;
import org.springframework.boot.test.context.assertj.AssertableApplicationContext;
@ -58,6 +57,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException; @@ -58,6 +57,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Stephane Nicoll
* @author Moritz Halbritter
*/
@SuppressWarnings("removal")
class ServletEndpointDiscovererTests {
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner();
@ -135,7 +135,8 @@ class ServletEndpointDiscovererTests { @@ -135,7 +135,8 @@ class ServletEndpointDiscovererTests {
@Test
void shouldRegisterHints() {
RuntimeHints runtimeHints = new RuntimeHints();
new ServletEndpointDiscovererRuntimeHints().registerHints(runtimeHints, getClass().getClassLoader());
new ServletEndpointDiscoverer.ServletEndpointDiscovererRuntimeHints().registerHints(runtimeHints,
getClass().getClassLoader());
assertThat(RuntimeHintsPredicates.reflection()
.onType(ServletEndpointFilter.class)
.withMemberCategories(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS)).accepts(runtimeHints);

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingIntegrationTests.java

@ -58,6 +58,7 @@ import org.springframework.web.util.DefaultUriBuilderFactory; @@ -58,6 +58,7 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
* @author Phillip Webb
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingIntegrationTests {
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/reactive/ControllerEndpointHandlerMappingTests.java

@ -46,6 +46,7 @@ import static org.mockito.Mockito.mock; @@ -46,6 +46,7 @@ import static org.mockito.Mockito.mock;
* @author Phillip Webb
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingTests {
private final StaticApplicationContext context = new StaticApplicationContext();

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingIntegrationTests.java

@ -57,6 +57,7 @@ import org.springframework.web.util.DefaultUriBuilderFactory; @@ -57,6 +57,7 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
* @author Phillip Webb
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingIntegrationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner(

1
spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/endpoint/web/servlet/ControllerEndpointHandlerMappingTests.java

@ -43,6 +43,7 @@ import static org.mockito.Mockito.mock; @@ -43,6 +43,7 @@ import static org.mockito.Mockito.mock;
* @author Phillip Webb
* @author Stephane Nicoll
*/
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingTests {
private final StaticApplicationContext context = new StaticApplicationContext();

2
spring-boot-project/spring-boot-docs/src/docs/antora/modules/ROOT/pages/redirect.adoc

@ -726,10 +726,8 @@ @@ -726,10 +726,8 @@
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.health.writing-custom-health-indicators[#actuator.endpoints.health.writing-custom-health-indicators]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.hypermedia[#actuator.endpoints.hypermedia]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom[#actuator.endpoints.implementing-custom]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.controller[#actuator.endpoints.implementing-custom.controller]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.input[#actuator.endpoints.implementing-custom.input]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.input.conversion[#actuator.endpoints.implementing-custom.input.conversion]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.servlet[#actuator.endpoints.implementing-custom.servlet]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.web[#actuator.endpoints.implementing-custom.web]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.web.consumes-predicates[#actuator.endpoints.implementing-custom.web.consumes-predicates]
* xref:reference:actuator/endpoints.adoc#actuator.endpoints.implementing-custom.web.method-predicates[#actuator.endpoints.implementing-custom.web.method-predicates]

20
spring-boot-project/spring-boot-docs/src/docs/antora/modules/reference/pages/actuator/endpoints.adoc

@ -536,26 +536,6 @@ The latter is typically used to perform authorization checks by using its `isUse @@ -536,26 +536,6 @@ The latter is typically used to perform authorization checks by using its `isUse
[[actuator.endpoints.implementing-custom.servlet]]
=== Servlet Endpoints
A servlet can be exposed as an endpoint by implementing a class annotated with `@ServletEndpoint` that also implements `Supplier<EndpointServlet>`.
Servlet endpoints provide deeper integration with the servlet container but at the expense of portability.
They are intended to be used to expose an existing servlet as an endpoint.
For new endpoints, the `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever possible.
[[actuator.endpoints.implementing-custom.controller]]
=== Controller Endpoints
You can use `@ControllerEndpoint` and `@RestControllerEndpoint` to implement an endpoint that is exposed only by Spring MVC or Spring WebFlux.
Methods are mapped by using the standard annotations for Spring MVC and Spring WebFlux, such as `@RequestMapping` and `@GetMapping`, with the endpoint's ID being used as a prefix for the path.
Controller endpoints provide deeper integration with Spring's web frameworks but at the expense of portability.
The `@Endpoint` and `@WebEndpoint` annotations should be preferred whenever possible.
[[actuator.endpoints.health]]
== Health Information

1
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/ExampleRestControllerEndpoint.java

@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam; @@ -24,6 +24,7 @@ import org.springframework.web.bind.annotation.RequestParam;
@Component
@RestControllerEndpoint(id = "example")
@SuppressWarnings("removal")
public class ExampleRestControllerEndpoint {
@GetMapping("/echo")

1
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator-custom-security/src/main/java/smoketest/actuator/customsecurity/SampleActuatorCustomSecurityApplication.java

@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
@SuppressWarnings("removal")
public class SampleActuatorCustomSecurityApplication {
public static void main(String[] args) {

1
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-actuator/src/main/java/smoketest/actuator/SampleRestControllerEndpointWithException.java

@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice; @@ -31,6 +31,7 @@ import org.springframework.web.bind.annotation.RestControllerAdvice;
*/
@Component
@RestControllerEndpoint(id = "exception")
@SuppressWarnings("removal")
public class SampleRestControllerEndpointWithException {
@GetMapping("/")

2
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-secure-jersey/src/main/java/smoketest/secure/jersey/SampleSecureJerseyApplication.java

@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
@SuppressWarnings("removal")
public class SampleSecureJerseyApplication {
public static void main(String[] args) {
@ -43,6 +44,7 @@ public class SampleSecureJerseyApplication { @@ -43,6 +44,7 @@ public class SampleSecureJerseyApplication {
}
@ServletEndpoint(id = "se1")
@SuppressWarnings("removal")
static class TestServletEndpoint implements Supplier<EndpointServlet> {
@Override

Loading…
Cancel
Save