Skip to content

Commit ff5eb57

Browse files
committed
Re-enables tests caused by using reactor netty
Since spring-projects/spring-boot#42587, the default http client changed when webflux is on the classpath. Fixes gh-3562
1 parent 110c3e7 commit ff5eb57

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

spring-cloud-gateway-webflux/src/test/java/org/springframework/cloud/gateway/webflux/ProductionConfigurationTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424

2525
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
2626
import org.junit.jupiter.api.BeforeEach;
27-
import org.junit.jupiter.api.Disabled;
2827
import org.junit.jupiter.api.Test;
2928
import reactor.core.publisher.Flux;
3029
import reactor.core.publisher.Mono;
@@ -46,6 +45,7 @@
4645
import org.springframework.http.MediaType;
4746
import org.springframework.http.RequestEntity;
4847
import org.springframework.http.ResponseEntity;
48+
import org.springframework.http.client.SimpleClientHttpRequestFactory;
4949
import org.springframework.test.annotation.DirtiesContext;
5050
import org.springframework.test.context.ContextConfiguration;
5151
import org.springframework.web.bind.annotation.DeleteMapping;
@@ -59,7 +59,7 @@
5959

6060
import static org.assertj.core.api.Assertions.assertThat;
6161

62-
@SpringBootTest(properties = { "spring.cloud.gateway.proxy.skipped=host" }, webEnvironment = WebEnvironment.RANDOM_PORT)
62+
@SpringBootTest(properties = { "debug=true", "spring.cloud.gateway.proxy.skipped=host" }, webEnvironment = WebEnvironment.RANDOM_PORT)
6363
@ContextConfiguration(classes = TestApplication.class)
6464
@DirtiesContext
6565
public class ProductionConfigurationTests {
@@ -76,6 +76,7 @@ public class ProductionConfigurationTests {
7676
@BeforeEach
7777
public void init() throws Exception {
7878
application.setHome(new URI("http://localhost:" + port));
79+
rest.getRestTemplate().setRequestFactory(new SimpleClientHttpRequestFactory());
7980
}
8081

8182
@Test
@@ -245,7 +246,6 @@ public void headers() throws Exception {
245246
}
246247

247248
@Test
248-
@Disabled("https://github.com/spring-cloud/spring-cloud-gateway/issues/3562")
249249
public void forwardedHeaderUsesHost() throws Exception {
250250
Map<String, List<String>> headers = rest
251251
.exchange(RequestEntity.get(rest.getRestTemplate().getUriTemplateHandler().expand("/proxy/headers"))
@@ -266,7 +266,6 @@ public void deleteWithoutBody() throws Exception {
266266
}
267267

268268
@Test
269-
@Disabled("https://github.com/spring-cloud/spring-cloud-gateway/issues/3562")
270269
public void deleteWithBody() throws Exception {
271270
Foo foo = new Foo("to-be-deleted");
272271
ParameterizedTypeReference<Map<String, Foo>> returnType = new ParameterizedTypeReference<Map<String, Foo>>() {

0 commit comments

Comments
 (0)