Migrate RestTemplateBuilder to RestClient.Builder
ProprietaryMigrates Spring Boot's RestTemplateBuilder to the RestClient.Builder that Spring Boot auto-configures. Retypes every RestTemplateBuilder usage, replaces new RestTemplateBuilder() with RestClient.builder() and renames rootUri/baseUri to baseUrl and errorHandler to defaultStatusHandler; build() and defaultHeader are the same on both builders. As RestClient.Builder is mutable while RestTemplateBuilder is not, configuration applied to an existing builder (a field, a parameter, ...) is applied to a clone() of it. Builder methods without an equivalent on RestClient.Builder are marked with a TODO comment. As build() then returns a RestClient, run this as part of MigrateRestTemplateToRestClient.
io. moderne. java. spring. boot3. MigrateRestTemplateBuilderToRestClientBuildermod run . --recipe= io. moderne. java. spring. boot3. MigrateRestTemplateBuilderToRestClientBuilderInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.