From 785aab8ad5bbbfb7deefceefb6fbc0c86f938f15 Mon Sep 17 00:00:00 2001 From: rstoyanchev Date: Tue, 24 Jun 2025 10:21:59 +0100 Subject: [PATCH] Rename ApiDeprecationHandler to insert "Version" The name is a bit long, but it is necessary to indicate it's a handler for a deprecation version, and the decision is based on the version, not an individual endpoint. See gh-35049 --- ...er.java => ApiVersionDeprecationHandler.java} | 6 +++--- .../web/accept/ApiVersionStrategy.java | 2 +- .../web/accept/DefaultApiVersionStrategy.java | 4 ++-- ...=> StandardApiVersionDeprecationHandler.java} | 16 ++++++++-------- ...andardApiVersionDeprecationHandlerTests.java} | 6 +++--- ...er.java => ApiVersionDeprecationHandler.java} | 4 ++-- .../web/reactive/accept/ApiVersionStrategy.java | 2 +- .../accept/DefaultApiVersionStrategy.java | 4 ++-- ...=> StandardApiVersionDeprecationHandler.java} | 16 ++++++++-------- .../reactive/config/ApiVersionConfigurer.java | 10 +++++----- ...andardApiVersionDeprecationHandlerTests.java} | 6 +++--- .../RequestMappingVersionIntegrationTests.java | 4 ++-- .../config/annotation/ApiVersionConfigurer.java | 10 +++++----- .../RequestMappingVersionHandlerMethodTests.java | 4 ++-- 14 files changed, 47 insertions(+), 47 deletions(-) rename spring-web/src/main/java/org/springframework/web/accept/{ApiDeprecationHandler.java => ApiVersionDeprecationHandler.java} (91%) rename spring-web/src/main/java/org/springframework/web/accept/{StandardApiDeprecationHandler.java => StandardApiVersionDeprecationHandler.java} (92%) rename spring-web/src/test/java/org/springframework/web/accept/{StandardApiDeprecationHandlerTests.java => StandardApiVersionDeprecationHandlerTests.java} (91%) rename spring-webflux/src/main/java/org/springframework/web/reactive/accept/{ApiDeprecationHandler.java => ApiVersionDeprecationHandler.java} (94%) rename spring-webflux/src/main/java/org/springframework/web/reactive/accept/{StandardApiDeprecationHandler.java => StandardApiVersionDeprecationHandler.java} (93%) rename spring-webflux/src/test/java/org/springframework/web/reactive/accept/{StandardApiDeprecationHandlerTests.java => StandardApiVersionDeprecationHandlerTests.java} (91%) diff --git a/spring-web/src/main/java/org/springframework/web/accept/ApiDeprecationHandler.java b/spring-web/src/main/java/org/springframework/web/accept/ApiVersionDeprecationHandler.java similarity index 91% rename from spring-web/src/main/java/org/springframework/web/accept/ApiDeprecationHandler.java rename to spring-web/src/main/java/org/springframework/web/accept/ApiVersionDeprecationHandler.java index 5ca59aa5d4..a9e04621ca 100644 --- a/spring-web/src/main/java/org/springframework/web/accept/ApiDeprecationHandler.java +++ b/spring-web/src/main/java/org/springframework/web/accept/ApiVersionDeprecationHandler.java @@ -22,13 +22,13 @@ import jakarta.servlet.http.HttpServletResponse; /** * Contract to add handling of requests with a deprecated API version. Typically, * this involves use of response headers to send hints and information about - * the deprecation to clients. + * the deprecated version to clients. * * @author Rossen Stoyanchev * @since 7.0 - * @see StandardApiDeprecationHandler + * @see StandardApiVersionDeprecationHandler */ -public interface ApiDeprecationHandler { +public interface ApiVersionDeprecationHandler { /** * Check if the requested API version is deprecated, and if so handle it diff --git a/spring-web/src/main/java/org/springframework/web/accept/ApiVersionStrategy.java b/spring-web/src/main/java/org/springframework/web/accept/ApiVersionStrategy.java index 46ae7c1b50..1dc1496197 100644 --- a/spring-web/src/main/java/org/springframework/web/accept/ApiVersionStrategy.java +++ b/spring-web/src/main/java/org/springframework/web/accept/ApiVersionStrategy.java @@ -69,7 +69,7 @@ public interface ApiVersionStrategy { * @param version the resolved and parsed request version * @param request the current request * @param response the current response - * @see ApiDeprecationHandler + * @see ApiVersionDeprecationHandler */ void handleDeprecations(Comparable version, HttpServletRequest request, HttpServletResponse response); diff --git a/spring-web/src/main/java/org/springframework/web/accept/DefaultApiVersionStrategy.java b/spring-web/src/main/java/org/springframework/web/accept/DefaultApiVersionStrategy.java index 89bcfcd2a9..7f199318bd 100644 --- a/spring-web/src/main/java/org/springframework/web/accept/DefaultApiVersionStrategy.java +++ b/spring-web/src/main/java/org/springframework/web/accept/DefaultApiVersionStrategy.java @@ -44,7 +44,7 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy { private final @Nullable Comparable defaultVersion; - private final @Nullable ApiDeprecationHandler deprecationHandler; + private final @Nullable ApiVersionDeprecationHandler deprecationHandler; private final Set> supportedVersions = new TreeSet<>(); @@ -65,7 +65,7 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy { public DefaultApiVersionStrategy( List versionResolvers, ApiVersionParser versionParser, boolean versionRequired, @Nullable String defaultVersion, - @Nullable ApiDeprecationHandler deprecationHandler) { + @Nullable ApiVersionDeprecationHandler deprecationHandler) { Assert.notEmpty(versionResolvers, "At least one ApiVersionResolver is required"); Assert.notNull(versionParser, "ApiVersionParser is required"); diff --git a/spring-web/src/main/java/org/springframework/web/accept/StandardApiDeprecationHandler.java b/spring-web/src/main/java/org/springframework/web/accept/StandardApiVersionDeprecationHandler.java similarity index 92% rename from spring-web/src/main/java/org/springframework/web/accept/StandardApiDeprecationHandler.java rename to spring-web/src/main/java/org/springframework/web/accept/StandardApiVersionDeprecationHandler.java index eb1aabe577..54ed9dcb76 100644 --- a/spring-web/src/main/java/org/springframework/web/accept/StandardApiDeprecationHandler.java +++ b/spring-web/src/main/java/org/springframework/web/accept/StandardApiVersionDeprecationHandler.java @@ -33,7 +33,7 @@ import org.springframework.http.MediaType; import org.springframework.util.Assert; /** - * {@code ApiDeprecationHandler} based on + * {@code ApiVersionDeprecationHandler} based on * RFC 9745 and * RFC 8594 that * provides the option to set the "Deprecation" and "Sunset" response headers, @@ -45,7 +45,7 @@ import org.springframework.util.Assert; * @author Rossen Stoyanchev * @since 7.0 */ -public class StandardApiDeprecationHandler implements ApiDeprecationHandler { +public class StandardApiVersionDeprecationHandler implements ApiVersionDeprecationHandler { private final ApiVersionParser versionParser; @@ -57,9 +57,9 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { *

By default, {@link SemanticApiVersionParser} is used to parse configured * API versions, so those can be compared to request versions parsed at runtime. * If you have a custom parser, then please use the - * {@link #StandardApiDeprecationHandler(ApiVersionParser)} constructor. + * {@link #StandardApiVersionDeprecationHandler(ApiVersionParser)} constructor. */ - public StandardApiDeprecationHandler() { + public StandardApiVersionDeprecationHandler() { this(new SemanticApiVersionParser()); } @@ -68,7 +68,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { * This needs to be the same as the parser type used at runtime to parse * request versions. */ - public StandardApiDeprecationHandler(ApiVersionParser parser) { + public StandardApiVersionDeprecationHandler(ApiVersionParser parser) { this.versionParser = parser; } @@ -109,7 +109,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { @Override public String toString() { - return "StandardApiDeprecationHandler " + this.infos.values(); + return "StandardApiVersionDeprecationHandler " + this.infos.values(); } @@ -122,7 +122,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { private VersionSpec(Comparable version) { this.version = version; - StandardApiDeprecationHandler.this.infos.put(version, new VersionInfo(version)); + StandardApiVersionDeprecationHandler.this.infos.put(version, new VersionInfo(version)); } /** @@ -198,7 +198,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { } private VersionSpec map(Function function) { - StandardApiDeprecationHandler.this.infos.compute(this.version, (version, versionInfo) -> { + StandardApiVersionDeprecationHandler.this.infos.compute(this.version, (version, versionInfo) -> { Assert.state(versionInfo != null, "No VersionInfo"); return function.apply(versionInfo); }); diff --git a/spring-web/src/test/java/org/springframework/web/accept/StandardApiDeprecationHandlerTests.java b/spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java similarity index 91% rename from spring-web/src/test/java/org/springframework/web/accept/StandardApiDeprecationHandlerTests.java rename to spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java index 920b2cbea7..a094da0096 100644 --- a/spring-web/src/test/java/org/springframework/web/accept/StandardApiDeprecationHandlerTests.java +++ b/spring-web/src/test/java/org/springframework/web/accept/StandardApiVersionDeprecationHandlerTests.java @@ -28,10 +28,10 @@ import org.springframework.web.testfixture.servlet.MockHttpServletResponse; import static org.assertj.core.api.Assertions.assertThat; /** - * Unit tests for {@link StandardApiDeprecationHandler}. + * Unit tests for {@link StandardApiVersionDeprecationHandler}. * @author Rossen Stoyanchev */ -public class StandardApiDeprecationHandlerTests { +public class StandardApiVersionDeprecationHandlerTests { private final MockHttpServletRequest request = new MockHttpServletRequest(); @@ -45,7 +45,7 @@ public class StandardApiDeprecationHandlerTests { String sunsetUrl = "https://example.org/sunset"; ApiVersionParser parser = version -> version; - StandardApiDeprecationHandler handler = new StandardApiDeprecationHandler(parser); + StandardApiVersionDeprecationHandler handler = new StandardApiVersionDeprecationHandler(parser); handler.configureVersion("1.1") .setDeprecationDate(getDate("Fri, 30 Jun 2023 23:59:59 GMT")) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiDeprecationHandler.java b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionDeprecationHandler.java similarity index 94% rename from spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiDeprecationHandler.java rename to spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionDeprecationHandler.java index e78d1cca7c..60951a763d 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiDeprecationHandler.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionDeprecationHandler.java @@ -21,12 +21,12 @@ import org.springframework.web.server.ServerWebExchange; /** * Contract to add handling of requests with a deprecated API version. Typically, * this involves use of response headers to send hints and information about - * the deprecation to clients. + * the deprecated version to clients. * * @author Rossen Stoyanchev * @since 7.0 */ -public interface ApiDeprecationHandler { +public interface ApiVersionDeprecationHandler { /** * Check if the requested API version is deprecated, and if so handle it diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionStrategy.java b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionStrategy.java index a3061ebb3f..994f4837bb 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionStrategy.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/ApiVersionStrategy.java @@ -70,7 +70,7 @@ public interface ApiVersionStrategy { * to specify relevant dates and provide links to further details. * @param version the resolved and parsed request version * @param exchange the current exchange - * @see ApiDeprecationHandler + * @see ApiVersionDeprecationHandler */ void handleDeprecations(Comparable version, ServerWebExchange exchange); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategy.java b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategy.java index b312f9de59..ff8ba4563d 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategy.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/DefaultApiVersionStrategy.java @@ -52,7 +52,7 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy { private final Set> detectedVersions = new TreeSet<>(); - private final @Nullable ApiDeprecationHandler deprecationHandler; + private final @Nullable ApiVersionDeprecationHandler deprecationHandler; /** @@ -74,7 +74,7 @@ public class DefaultApiVersionStrategy implements ApiVersionStrategy { public DefaultApiVersionStrategy( List versionResolvers, ApiVersionParser versionParser, boolean versionRequired, @Nullable String defaultVersion, boolean detectSupportedVersions, - @Nullable ApiDeprecationHandler deprecationHandler) { + @Nullable ApiVersionDeprecationHandler deprecationHandler) { Assert.notEmpty(versionResolvers, "At least one ApiVersionResolver is required"); Assert.notNull(versionParser, "ApiVersionParser is required"); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/StandardApiDeprecationHandler.java b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandler.java similarity index 93% rename from spring-webflux/src/main/java/org/springframework/web/reactive/accept/StandardApiDeprecationHandler.java rename to spring-webflux/src/main/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandler.java index 54f387b091..231f7f57c4 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/accept/StandardApiDeprecationHandler.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandler.java @@ -34,7 +34,7 @@ import org.springframework.web.accept.SemanticApiVersionParser; import org.springframework.web.server.ServerWebExchange; /** - * {@code ApiDeprecationHandler} based on + * {@code ApiVersionDeprecationHandler} based on * RFC 9745 and * RFC 8594 that * provides the option to set the "Deprecation" and "Sunset" response headers, @@ -46,7 +46,7 @@ import org.springframework.web.server.ServerWebExchange; * @author Rossen Stoyanchev * @since 7.0 */ -public class StandardApiDeprecationHandler implements ApiDeprecationHandler { +public class StandardApiVersionDeprecationHandler implements ApiVersionDeprecationHandler { private final ApiVersionParser versionParser; @@ -58,9 +58,9 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { *

By default, {@link SemanticApiVersionParser} is used to parse configured * API versions, so those can be compared to request versions parsed at runtime. * If you have a custom parser, then please use the - * {@link #StandardApiDeprecationHandler(ApiVersionParser)} constructor. + * {@link #StandardApiVersionDeprecationHandler(ApiVersionParser)} constructor. */ - public StandardApiDeprecationHandler() { + public StandardApiVersionDeprecationHandler() { this(new SemanticApiVersionParser()); } @@ -69,7 +69,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { * This needs to be the same as the parser type used at runtime to parse * request versions. */ - public StandardApiDeprecationHandler(ApiVersionParser parser) { + public StandardApiVersionDeprecationHandler(ApiVersionParser parser) { this.versionParser = parser; } @@ -108,7 +108,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { @Override public String toString() { - return "StandardApiDeprecationHandler " + this.infos.values(); + return "StandardApiVersionDeprecationHandler " + this.infos.values(); } @@ -121,7 +121,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { private VersionSpec(Comparable version) { this.version = version; - StandardApiDeprecationHandler.this.infos.put(version, new VersionInfo(version)); + StandardApiVersionDeprecationHandler.this.infos.put(version, new VersionInfo(version)); } /** @@ -197,7 +197,7 @@ public class StandardApiDeprecationHandler implements ApiDeprecationHandler { } private VersionSpec map(Function function) { - StandardApiDeprecationHandler.this.infos.compute(this.version, (version, versionInfo) -> { + StandardApiVersionDeprecationHandler.this.infos.compute(this.version, (version, versionInfo) -> { Assert.state(versionInfo != null, "No VersionInfo"); return function.apply(versionInfo); }); diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/ApiVersionConfigurer.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/ApiVersionConfigurer.java index 2a891a3171..f7874297dc 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/ApiVersionConfigurer.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/ApiVersionConfigurer.java @@ -29,13 +29,13 @@ import org.springframework.http.MediaType; import org.springframework.web.accept.ApiVersionParser; import org.springframework.web.accept.InvalidApiVersionException; import org.springframework.web.accept.SemanticApiVersionParser; -import org.springframework.web.reactive.accept.ApiDeprecationHandler; +import org.springframework.web.reactive.accept.ApiVersionDeprecationHandler; import org.springframework.web.reactive.accept.ApiVersionResolver; import org.springframework.web.reactive.accept.ApiVersionStrategy; import org.springframework.web.reactive.accept.DefaultApiVersionStrategy; import org.springframework.web.reactive.accept.MediaTypeParamApiVersionResolver; import org.springframework.web.reactive.accept.PathApiVersionResolver; -import org.springframework.web.reactive.accept.StandardApiDeprecationHandler; +import org.springframework.web.reactive.accept.StandardApiVersionDeprecationHandler; /** * Configure API versioning. @@ -53,7 +53,7 @@ public class ApiVersionConfigurer { private @Nullable String defaultVersion; - private @Nullable ApiDeprecationHandler deprecationHandler; + private @Nullable ApiVersionDeprecationHandler deprecationHandler; private final Set supportedVersions = new LinkedHashSet<>(); @@ -150,9 +150,9 @@ public class ApiVersionConfigurer { * version. Typically, this involves sending hints and information about * the deprecation in response headers. * @param handler the handler to use - * @see StandardApiDeprecationHandler + * @see StandardApiVersionDeprecationHandler */ - public ApiVersionConfigurer setDeprecationHandler(ApiDeprecationHandler handler) { + public ApiVersionConfigurer setDeprecationHandler(ApiVersionDeprecationHandler handler) { this.deprecationHandler = handler; return this; } diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiDeprecationHandlerTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java similarity index 91% rename from spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiDeprecationHandlerTests.java rename to spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java index d894c31451..2cb0b953c5 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiDeprecationHandlerTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/accept/StandardApiVersionDeprecationHandlerTests.java @@ -31,10 +31,10 @@ import org.springframework.web.testfixture.server.MockServerWebExchange; import static org.assertj.core.api.AssertionsForInterfaceTypes.assertThat; /** - * Unit tests for {@link StandardApiDeprecationHandler}. + * Unit tests for {@link StandardApiVersionDeprecationHandler}. * @author Rossen Stoyanchev */ -public class StandardApiDeprecationHandlerTests { +public class StandardApiVersionDeprecationHandlerTests { private final ServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("/").build()); @@ -46,7 +46,7 @@ public class StandardApiDeprecationHandlerTests { String sunsetUrl = "https://example.org/sunset"; ApiVersionParser parser = version -> version; - StandardApiDeprecationHandler handler = new StandardApiDeprecationHandler(parser); + StandardApiVersionDeprecationHandler handler = new StandardApiVersionDeprecationHandler(parser); handler.configureVersion("1.1") .setDeprecationDate(getDate("Fri, 30 Jun 2023 23:59:59 GMT")) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java index 5d1cbd8007..bfc090b667 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestMappingVersionIntegrationTests.java @@ -25,7 +25,7 @@ import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.client.HttpClientErrorException; -import org.springframework.web.reactive.accept.StandardApiDeprecationHandler; +import org.springframework.web.reactive.accept.StandardApiVersionDeprecationHandler; import org.springframework.web.reactive.config.ApiVersionConfigurer; import org.springframework.web.reactive.config.EnableWebFlux; import org.springframework.web.reactive.config.WebFluxConfigurer; @@ -90,7 +90,7 @@ public class RequestMappingVersionIntegrationTests extends AbstractRequestMappin @Override public void configureApiVersioning(ApiVersionConfigurer configurer) { - StandardApiDeprecationHandler handler = new StandardApiDeprecationHandler(); + StandardApiVersionDeprecationHandler handler = new StandardApiVersionDeprecationHandler(); handler.configureVersion("1").setDeprecationLink(URI.create("https://example.org/deprecation")); configurer.useRequestHeader("X-API-Version") diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ApiVersionConfigurer.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ApiVersionConfigurer.java index fcc652d5ac..d2a62e1931 100644 --- a/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ApiVersionConfigurer.java +++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ApiVersionConfigurer.java @@ -26,7 +26,7 @@ import java.util.Set; import org.jspecify.annotations.Nullable; import org.springframework.http.MediaType; -import org.springframework.web.accept.ApiDeprecationHandler; +import org.springframework.web.accept.ApiVersionDeprecationHandler; import org.springframework.web.accept.ApiVersionParser; import org.springframework.web.accept.ApiVersionResolver; import org.springframework.web.accept.ApiVersionStrategy; @@ -34,7 +34,7 @@ import org.springframework.web.accept.DefaultApiVersionStrategy; import org.springframework.web.accept.MediaTypeParamApiVersionResolver; import org.springframework.web.accept.PathApiVersionResolver; import org.springframework.web.accept.SemanticApiVersionParser; -import org.springframework.web.accept.StandardApiDeprecationHandler; +import org.springframework.web.accept.StandardApiVersionDeprecationHandler; /** * Configure API versioning. @@ -52,7 +52,7 @@ public class ApiVersionConfigurer { private @Nullable String defaultVersion; - private @Nullable ApiDeprecationHandler deprecationHandler; + private @Nullable ApiVersionDeprecationHandler deprecationHandler; private final Set supportedVersions = new LinkedHashSet<>(); @@ -147,9 +147,9 @@ public class ApiVersionConfigurer { * version. Typically, this involves sending hints and information about * the deprecation in response headers. * @param handler the handler to use - * @see StandardApiDeprecationHandler + * @see StandardApiVersionDeprecationHandler */ - public ApiVersionConfigurer setDeprecationHandler(ApiDeprecationHandler handler) { + public ApiVersionConfigurer setDeprecationHandler(ApiVersionDeprecationHandler handler) { this.deprecationHandler = handler; return this; } diff --git a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java index 59ea21bd79..c926ed9a1d 100644 --- a/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java +++ b/spring-webmvc/src/test/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingVersionHandlerMethodTests.java @@ -23,7 +23,7 @@ import jakarta.servlet.ServletException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.springframework.web.accept.StandardApiDeprecationHandler; +import org.springframework.web.accept.StandardApiVersionDeprecationHandler; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.support.AnnotationConfigWebApplicationContext; @@ -99,7 +99,7 @@ public class RequestMappingVersionHandlerMethodTests { @Override public void configureApiVersioning(ApiVersionConfigurer configurer) { - StandardApiDeprecationHandler handler = new StandardApiDeprecationHandler(); + StandardApiVersionDeprecationHandler handler = new StandardApiVersionDeprecationHandler(); handler.configureVersion("1").setDeprecationLink(URI.create("https://example.org/deprecation")); configurer.useRequestHeader("X-API-Version")