From 12850c5fc4d6fe51c290e33cce5a836d5875b08a Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 23 Jun 2017 16:22:10 -0400 Subject: [PATCH] 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 --- .../test/web/reactive/server/DefaultWebTestClientBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClientBuilder.java b/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClientBuilder.java index 5d07813ddf..41d007da75 100644 --- a/spring-test/src/main/java/org/springframework/test/web/reactive/server/DefaultWebTestClientBuilder.java +++ b/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())); DefaultWebTestClientBuilder webTestClientBuilder = new DefaultWebTestClientBuilder( - this.webClientBuilder.build().mutate(), this.httpHandlerBuilder, + this.webClientBuilder.cloneBuilder(), this.httpHandlerBuilder, this.connector, this.responseTimeout); return new DefaultWebTestClient(this.webClientBuilder,