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
This commit is contained in:
Rossen Stoyanchev
2017-06-23 16:22:10 -04:00
parent 8ac29c8ce7
commit 12850c5fc4

View File

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