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:
Brian Clozel
2026-03-31 12:28:44 +02:00
parent 7473cd5fbc
commit 83c2afb643
35 changed files with 91 additions and 10 deletions
@@ -47,7 +47,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Juergen Hoeller
*/
@SpringJUnitWebConfig
@SuppressWarnings("deprecation")
@SuppressWarnings({"deprecation", "removal"})
class MockMvcClientHttpRequestFactoryTests {
private final RestTemplate template;