Closed
Description
In #17091 we've moved some of the customizations of RestTemplateBuilder
from a regular interceptor to a wrapping ClientHttpRequestFactory
. This makes the created RestTemplate
incompatible with MockRestServiceServer
as the latter will override the ClientHttpRequestFactory
when it binds a rest template to a mock server.
I am not sure how we could avoid that really as the purpose of the factory is to create a request and it must be mocked.
I discovered this as part of testing a component that valides the proper Authorization
header is sent. Because the factory is overridden, this header isn't processed at all anymore when managed by MockRestServiceServer
.