mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-10-05 22:49:02 +00:00
Deprecate RestTemplate and related types
As announced in "the state of HTTP clients in Spring" blog post (https://spring.io/blog/2025/09/30/the-state-of-http-clients-in-spring), the deprecation timeline for `RestTemplate` was announced last November and docs were updated accordingly. This commit `@Deprecate` `RestTemplate` and related types for removal to send a stronger signal to our community. The actual removal is scheduled for Spring Framework 8.0 (not yet scheduled). Closes gh-36574
This commit is contained in:
+3
@@ -53,7 +53,10 @@ import org.springframework.web.socket.sockjs.frame.SockJsFrame;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @since 4.1
|
||||
* @deprecated as of 7.1 in favor of {@link RestClientXhrTransport}.
|
||||
*/
|
||||
@Deprecated(since = "7.1", forRemoval = true)
|
||||
@SuppressWarnings("removal")
|
||||
public class RestTemplateXhrTransport extends AbstractXhrTransport {
|
||||
|
||||
private final RestOperations restTemplate;
|
||||
|
||||
+2
@@ -67,6 +67,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
@SuppressWarnings("removal")
|
||||
class RestTemplateXhrTransportTests {
|
||||
|
||||
private static final JacksonJsonSockJsMessageCodec CODEC = new JacksonJsonSockJsMessageCodec();
|
||||
@@ -201,6 +202,7 @@ class RestTemplateXhrTransportTests {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("removal")
|
||||
private static class TestRestTemplate extends RestTemplate {
|
||||
|
||||
private Queue<ClientHttpResponse> responses = new LinkedBlockingDeque<>();
|
||||
|
||||
Reference in New Issue
Block a user