Skip to content

Commit

Permalink
Re-enables tests caused by using reactor netty
Browse files Browse the repository at this point in the history
Since spring-projects/spring-boot#42587, the default http client changed when webflux is on the classpath.

Fixes spring-cloudgh-3562
  • Loading branch information
spencergibb committed Oct 22, 2024
1 parent 0610aac commit e0404cb
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand All @@ -46,6 +45,7 @@
import org.springframework.http.MediaType;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.SimpleClientHttpRequestFactory;
import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.web.bind.annotation.DeleteMapping;
Expand All @@ -59,7 +59,7 @@

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

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

@Test
Expand Down Expand Up @@ -245,7 +246,6 @@ public void headers() throws Exception {
}

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

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

0 comments on commit e0404cb

Please sign in to comment.