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 #9522 and #9166 , we're making sure that codecs auto-configuration and other customizations are properly applied to the WebClient when using WebClient.Builder components created by Boot.
This issue is about possibly aligning some/all of those in WebTestClient.
Looking at Spring Framework's WebClient.Builder and WebTestClient.Builder, those interfaces don't share a common parent even if they have a few identical methods.
With the current arrangement, Spring Boot could apply all CodecCustomizer instances to the WebTestClient; in that case, both client and test client instances would share the same codec configuration.
Spring Boot could go further (and actually align its behavior there with what happens with RestTemplateBuilder and TestResTemplate) and apply all customizations done by WebClient.Builder to the test client. The fact that WebClient.Builder and WebTestClient.Builder aren't related make it harder to achieve. Also, the WebTestClient can be used for integration tests and mock environments, each having different configuration capabilities.
Applying CodecCustomizer instances might be enough, and other features should not be applied to the test client. Indeed, a WebClient is probably used to call remote services and the test client the application itself...
The text was updated successfully, but these errors were encountered:
This commit applies what's been done in spring-projectsgh-9166 for WebFlux client and
server, but for the `WebTestClient` auto-configuration.
`WebTestClient` can be configured for mock or integration tests and this
change applies `CodecCustomizer` beans to the client being built.
Closesspring-projectsgh-9577
In #9522 and #9166 , we're making sure that codecs auto-configuration and other customizations are properly applied to the
WebClient
when usingWebClient.Builder
components created by Boot.This issue is about possibly aligning some/all of those in
WebTestClient
.Looking at Spring Framework's
WebClient.Builder
andWebTestClient.Builder
, those interfaces don't share a common parent even if they have a few identical methods.With the current arrangement, Spring Boot could apply all
CodecCustomizer
instances to theWebTestClient
; in that case, both client and test client instances would share the same codec configuration.Spring Boot could go further (and actually align its behavior there with what happens with
RestTemplateBuilder
andTestResTemplate
) and apply all customizations done byWebClient.Builder
to the test client. The fact thatWebClient.Builder
andWebTestClient.Builder
aren't related make it harder to achieve. Also, theWebTestClient
can be used for integration tests and mock environments, each having different configuration capabilities.Applying
CodecCustomizer
instances might be enough, and other features should not be applied to the test client. Indeed, aWebClient
is probably used to call remote services and the test client the application itself...The text was updated successfully, but these errors were encountered: