Spring Boot RestClient as a singleton or create new instances per request
Looking through the documentation here, the expected pattern to use for RestClient
is to autowire the RestClient.Builder
and then build the RestClient
in the constructor method of a service. While this works great when using in a regular class, it does not work as well when testing.