diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayConfiguration.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayConfiguration.java index 55690d2ad..97d03ecd7 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayConfiguration.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/config/GatewayConfiguration.java @@ -25,6 +25,7 @@ import org.springframework.context.annotation.Configuration; */ @Configuration public class GatewayConfiguration { + @Bean public Marker gatewayMarker() { return new Marker(); diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java index 2210c80b6..dce35c8dd 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java @@ -43,11 +43,6 @@ public class BaseWebClientTests { protected static final String ROUTE_ID_HEADER = "X-Gateway-Route-Id"; protected static final Duration DURATION = Duration.ofSeconds(5); - static { - //TODO: wait for option in boot 2.0 - System.setProperty("java.net.preferIPv4Stack", "true"); - } - @LocalServerPort protected int port = 0; diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java index dc5e060b9..0a505f5d0 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/test/GatewayTestApplication.java @@ -90,7 +90,6 @@ public class GatewayTestApplication { } public static void main(String[] args) { - System.setProperty("java.net.preferIPv4Stack", "true"); //Remove when configurable SpringApplication.run(GatewayTestApplication.class, args); } } diff --git a/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java b/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java index 1fc1b3f85..945954bc9 100644 --- a/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java +++ b/spring-cloud-gateway-sample/src/main/java/org/springframework/cloud/gateway/sample/GatewaySampleApplication.java @@ -53,7 +53,6 @@ public class GatewaySampleApplication { } public static void main(String[] args) { - System.setProperty("java.net.preferIPv4Stack", "true"); //Remove when configurable SpringApplication.run(GatewaySampleApplication.class, args); } } diff --git a/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java b/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java index 00afb147e..640e3de98 100644 --- a/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java +++ b/spring-cloud-gateway-sample/src/test/java/org/springframework/cloud/gateway/sample/GatewaySampleApplicationTests.java @@ -41,10 +41,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @RunWith(SpringRunner.class) @SpringBootTest(classes = GatewaySampleApplication.class, webEnvironment = RANDOM_PORT) public class GatewaySampleApplicationTests { - static { - //TODO: wait for option in boot 2.0 - System.setProperty("java.net.preferIPv4Stack", "true"); - } @LocalServerPort protected int port = 0;