Deprecate ControllerEndpointHandlerMapping for MVC and WebFlux

Closes gh-42498
This commit is contained in:
Andy Wilkinson
2024-10-02 13:46:57 +01:00
parent 9ece00bda4
commit 93e5b3a0ff
8 changed files with 24 additions and 12 deletions

View File

@@ -47,7 +47,6 @@ import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.endpoint.web.reactive.AdditionalHealthEndpointPathsWebFluxHandlerMapping;
import org.springframework.boot.actuate.endpoint.web.reactive.ControllerEndpointHandlerMapping;
import org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
@@ -129,12 +128,13 @@ public class WebFluxEndpointManagementContextConfiguration {
@Bean
@ConditionalOnMissingBean
@SuppressWarnings("removal")
public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
@Deprecated(since = "3.3.5", forRemoval = true)
public org.springframework.boot.actuate.endpoint.web.reactive.ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties) {
EndpointMapping endpointMapping = new EndpointMapping(webEndpointProperties.getBasePath());
return new ControllerEndpointHandlerMapping(endpointMapping, controllerEndpointsSupplier.getEndpoints(),
corsProperties.toCorsConfiguration());
return new org.springframework.boot.actuate.endpoint.web.reactive.ControllerEndpointHandlerMapping(
endpointMapping, controllerEndpointsSupplier.getEndpoints(), corsProperties.toCorsConfiguration());
}
@Bean

View File

@@ -43,7 +43,6 @@ import org.springframework.boot.actuate.endpoint.web.ExposableWebEndpoint;
import org.springframework.boot.actuate.endpoint.web.WebEndpointsSupplier;
import org.springframework.boot.actuate.endpoint.web.WebServerNamespace;
import org.springframework.boot.actuate.endpoint.web.servlet.AdditionalHealthEndpointPathsWebMvcHandlerMapping;
import org.springframework.boot.actuate.endpoint.web.servlet.ControllerEndpointHandlerMapping;
import org.springframework.boot.actuate.endpoint.web.servlet.WebMvcEndpointHandlerMapping;
import org.springframework.boot.actuate.health.HealthEndpoint;
import org.springframework.boot.actuate.health.HealthEndpointGroups;
@@ -124,12 +123,13 @@ public class WebMvcEndpointManagementContextConfiguration {
@Bean
@ConditionalOnMissingBean
@SuppressWarnings("removal")
public ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
@Deprecated(since = "3.3.5", forRemoval = true)
public org.springframework.boot.actuate.endpoint.web.servlet.ControllerEndpointHandlerMapping controllerEndpointHandlerMapping(
org.springframework.boot.actuate.endpoint.web.annotation.ControllerEndpointsSupplier controllerEndpointsSupplier,
CorsEndpointProperties corsProperties, WebEndpointProperties webEndpointProperties) {
EndpointMapping endpointMapping = new EndpointMapping(webEndpointProperties.getBasePath());
return new ControllerEndpointHandlerMapping(endpointMapping, controllerEndpointsSupplier.getEndpoints(),
corsProperties.toCorsConfiguration());
return new org.springframework.boot.actuate.endpoint.web.servlet.ControllerEndpointHandlerMapping(
endpointMapping, controllerEndpointsSupplier.getEndpoints(), corsProperties.toCorsConfiguration());
}
@Bean

View File

@@ -41,7 +41,9 @@ import org.springframework.web.util.pattern.PathPattern;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.5 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@Deprecated(since = "3.3.5", forRemoval = true)
@SuppressWarnings("removal")
public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMapping {

View File

@@ -42,7 +42,9 @@ import org.springframework.web.util.pattern.PathPattern;
*
* @author Phillip Webb
* @since 2.0.0
* @deprecated since 3.3.5 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@Deprecated(since = "3.3.5", forRemoval = true)
@SuppressWarnings("removal")
public class ControllerEndpointHandlerMapping extends RequestMappingHandlerMapping {

View File

@@ -57,8 +57,10 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
*
* @author Phillip Webb
* @author Stephane Nicoll
* @deprecated since 3.3.5 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@SuppressWarnings({ "deprecation", "removal" })
@SuppressWarnings("removal")
@Deprecated(since = "3.3.5", forRemoval = true)
class ControllerEndpointHandlerMappingIntegrationTests {
private final ReactiveWebApplicationContextRunner contextRunner = new ReactiveWebApplicationContextRunner(

View File

@@ -45,8 +45,10 @@ import static org.mockito.Mockito.mock;
*
* @author Phillip Webb
* @author Stephane Nicoll
* @deprecated since 3.3.5 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@SuppressWarnings({ "deprecation", "removal" })
@Deprecated(since = "3.3.5", forRemoval = true)
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingTests {
private final StaticApplicationContext context = new StaticApplicationContext();

View File

@@ -56,8 +56,10 @@ import org.springframework.web.util.DefaultUriBuilderFactory;
*
* @author Phillip Webb
* @author Stephane Nicoll
* @deprecated since 3.3.5 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@SuppressWarnings({ "deprecation", "removal" })
@Deprecated(since = "3.3.5", forRemoval = true)
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingIntegrationTests {
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner(

View File

@@ -42,8 +42,10 @@ import static org.mockito.Mockito.mock;
*
* @author Phillip Webb
* @author Stephane Nicoll
* @deprecated since 3.3.5 in favor of {@code @Endpoint} and {@code @WebEndpoint} support
*/
@SuppressWarnings({ "deprecation", "removal" })
@Deprecated(since = "3.3.5", forRemoval = true)
@SuppressWarnings("removal")
class ControllerEndpointHandlerMappingTests {
private final StaticApplicationContext context = new StaticApplicationContext();