From f42eea183e3a6f6b02c52928de23c75796fb698c Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Mon, 17 Nov 2025 09:39:50 +0100 Subject: [PATCH] Polishing tests Closes gh-35678 --- .../client/WebClientIntegrationTests.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java index b76e0309964..e870c28a6eb 100644 --- a/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java +++ b/spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java @@ -45,7 +45,6 @@ import mockwebserver3.MockWebServer; import mockwebserver3.RecordedRequest; import org.eclipse.jetty.client.Request; import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -72,14 +71,12 @@ import org.springframework.http.HttpStatusCode; import org.springframework.http.MediaType; import org.springframework.http.ResponseCookie; import org.springframework.http.ResponseEntity; -import org.springframework.http.client.MultipartBodyBuilder; import org.springframework.http.client.reactive.ClientHttpConnector; import org.springframework.http.client.reactive.HttpComponentsClientHttpConnector; import org.springframework.http.client.reactive.JdkClientHttpConnector; import org.springframework.http.client.reactive.JettyClientHttpConnector; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.web.reactive.function.BodyExtractors; -import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.reactive.function.client.WebClient.ResponseSpec; import org.springframework.web.testfixture.xml.Pojo; @@ -1323,35 +1320,6 @@ class WebClientIntegrationTests { .verify(Duration.ofSeconds(3)); } - @Disabled("Disabled until the test is no longer flaky") - @ParameterizedWebClientTest // gh-35678 - void failWhileSendingMultipartRequest(ClientHttpConnector connector) throws IOException { - startServer(connector); - prepareResponse(response -> response - .setHeader("Content-Type", "text/plain").body("Hello")); - - MultipartBodyBuilder data = new MultipartBodyBuilder(); - data.part("first", "success"); - data.asyncPart("second", - Mono.delay(Duration.ofMillis(500)).then(Mono.error(new IllegalStateException("multipart client error"))), - String.class); - - Mono> result = this.webClient.post() - .uri("/multipart").accept(MediaType.TEXT_PLAIN) - .body(BodyInserters.fromMultipartData(data.build())) - .retrieve() - .toEntity(String.class) - .log(); - - StepVerifier.create(result) - .expectErrorSatisfies(error -> assertThat(error) - .isInstanceOf(WebClientRequestException.class) - .hasMessageContaining("multipart client error")) - .verify(Duration.ofSeconds(5)); - - expectRequestCount(0); - } - private Mono doMalformedChunkedResponseTest( ClientHttpConnector connector, Function> handler) {