You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
In #17091 we've moved some of the customizations of
RestTemplateBuilder
from a regular interceptor to a wrappingClientHttpRequestFactory
. This makes the createdRestTemplate
incompatible withMockRestServiceServer
as the latter will override theClientHttpRequestFactory
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 byMockRestServiceServer
.The text was updated successfully, but these errors were encountered: