Fix test failure by using the new cloneBuilder method

The cloneBuilder helps to avoid the issue in the comment of the ticket.
Rather than creating the WebClient to then obtain a fresh builder which
causes connector instantiation, we now use the cloneBuilder

Issue: SPR-15674
master
Rossen Stoyanchev 7 years ago
parent 8ac29c8ce7
commit 12850c5fc4
  1. 2
      spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClientBuilder.java

@ -146,7 +146,7 @@ class DefaultWebTestClientBuilder implements WebTestClient.Builder {
new HttpHandlerConnector(this.httpHandlerBuilder.build())); new HttpHandlerConnector(this.httpHandlerBuilder.build()));
DefaultWebTestClientBuilder webTestClientBuilder = new DefaultWebTestClientBuilder( DefaultWebTestClientBuilder webTestClientBuilder = new DefaultWebTestClientBuilder(
this.webClientBuilder.build().mutate(), this.httpHandlerBuilder, this.webClientBuilder.cloneBuilder(), this.httpHandlerBuilder,
this.connector, this.responseTimeout); this.connector, this.responseTimeout);
return new DefaultWebTestClient(this.webClientBuilder, return new DefaultWebTestClient(this.webClientBuilder,

Loading…
Cancel
Save