Skip to content

GH-11268: Suppress RestTemplate removal warnings - #11270

Open
kalayciburak wants to merge 1 commit into
spring-projects:mainfrom
kalayciburak:GH-11268-suppress-resttemplate-deprecation
Open

GH-11268: Suppress RestTemplate removal warnings#11270
kalayciburak wants to merge 1 commit into
spring-projects:mainfrom
kalayciburak:GH-11268-suppress-resttemplate-deprecation

Conversation

@kalayciburak

@kalayciburak kalayciburak commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Add @SuppressWarnings("removal") on remaining RestTemplate-based HTTP outbound APIs until they are removed.

  • Keep the production RestTemplate wrappers as-is, just quiet the removal warnings
  • Drop test-side suppressions and move those cases onto RestClient
  • Remove RestTemplate parser coverage that already has a RestClient twin

Verification

  • ./gradlew :spring-integration-http:check

Fixes: gh-11268

@artembilan
artembilan requested a review from cppwfs August 14, 2026 13:44

@cppwfs cppwfs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much for your contributions! Its off to a great start!

*/
@SpringJUnitConfig
@DirtiesContext
@SuppressWarnings("removal")

@cppwfs cppwfs Aug 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the issue we don't want to suppress the warnings but rather replace RestTemplate with RestClient in the tests.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, dropped the test suppress and switched those to RestClient

handler.setBeanFactory(TEST_INTEGRATION_CONTEXT);
}

@SuppressWarnings("removal")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

*/
@SpringJUnitConfig
@DirtiesContext
@SuppressWarnings("removal")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per the issue we don't want to suppress the warnings but rather replace RestTemplate with RestClient in the tests.

*/
@SpringJUnitConfig
@DirtiesContext
@SuppressWarnings("removal")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto

@artembilan artembilan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right.

The RestTemplate is not our class to test around.
We would like to move to a replacement API as soon as possible.
Therefore, our tests must be fixed right now to prove that new API is good and have coverage for new API instead of the one out of support already.

And teach your AI agent that ./gradlew :spring-integration-http:check task is for everything what it iterates separately.

Thanks

Fixes: spring-projects#11268

Keep @SuppressWarnings("removal") on remaining RestTemplate-based HTTP
outbound APIs until that client is removed. Move HTTP outbound tests
onto RestClient instead of suppressing the old client in tests.

Signed-off-by: Burak KALAYCI <kalayciburak1996@gmail.com>
@kalayciburak
kalayciburak force-pushed the GH-11268-suppress-resttemplate-deprecation branch from ef80593 to 7690f06 Compare August 14, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Suppress RestTemplate Deprecation Warnings

3 participants