From f0e160fc67d276d22b2908b6421351feeba7f492 Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Fri, 20 Sep 2019 14:09:00 +0200 Subject: [PATCH] Execute WebClientDataBufferAllocatingTests during all builds This commit reverts b2704e1db64098410e1a515fe2c8f757da44b780 and configures the ReactorResourceFactory not to use global resources, thereby allowing all tests in WebClientDataBufferAllocatingTests to execute within approximately 2 seconds again on Mac OS. --- .../client/WebClientDataBufferAllocatingTests.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientDataBufferAllocatingTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientDataBufferAllocatingTests.java index 329c710df30..af8277532b7 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientDataBufferAllocatingTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientDataBufferAllocatingTests.java @@ -39,11 +39,9 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.http.client.reactive.ReactorResourceFactory; -import org.springframework.tests.EnabledForTestGroups; import org.springframework.web.reactive.function.UnsupportedMediaTypeException; import static org.assertj.core.api.Assertions.assertThat; -import static org.springframework.tests.TestGroup.PERFORMANCE; /** * WebClient integration tests focusing on data buffer management. @@ -51,25 +49,23 @@ import static org.springframework.tests.TestGroup.PERFORMANCE; * @author Rossen Stoyanchev * @author Sam Brannen */ -@EnabledForTestGroups(PERFORMANCE) public class WebClientDataBufferAllocatingTests extends AbstractDataBufferAllocatingTests { private static final Duration DELAY = Duration.ofSeconds(5); - private MockWebServer server; + private final ReactorResourceFactory factory = new ReactorResourceFactory(); + + private final MockWebServer server = new MockWebServer(); private WebClient webClient; - private ReactorResourceFactory factory; - @BeforeEach public void setUp() { - this.factory = new ReactorResourceFactory(); + this.factory.setUseGlobalResources(false); this.factory.afterPropertiesSet(); - this.server = new MockWebServer(); this.webClient = WebClient .builder() .clientConnector(initConnector())