Use RestTemplateBuilder#basicAuthentication

MSAL

RestTemplateBuilder#basicAuthorization was deprecated in 2.1.

org.openrewrite.java.spring.boot2.MigrateRestTemplateBuilderBasicAuthorization
mod run . --recipe=org.openrewrite.java.spring.boot2.MigrateRestTemplateBuilderBasicAuthorization

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.

Recipe list

It runs these recipes, in this order.

  1. Change method name org.springframework.boot.web.client.RestTemplateBuilder basicAuthorization(String, String) to basicAuthentication