From 671b4165c3772af1dea6abf775daaee7158cf521 Mon Sep 17 00:00:00 2001 From: spencergibb Date: Thu, 23 Feb 2023 13:40:52 -0500 Subject: [PATCH] Polish gh-2872 Fixes for gateway routes on management port. Updates the test to fail if NPE check isn't done. --- ...erMappingWithAutoconfiguredClientIntegrationTests.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingWithAutoconfiguredClientIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingWithAutoconfiguredClientIntegrationTests.java index 1727ee8e..c0b6330a 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingWithAutoconfiguredClientIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingWithAutoconfiguredClientIntegrationTests.java @@ -33,7 +33,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.util.SocketUtils; -import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -70,14 +69,9 @@ public class RoutePredicateHandlerMappingWithAutoconfiguredClientIntegrationTest @Value("${test.uri:http://httpbin.org:80}") String uri; - @GetMapping("/get") - String get() { - return "hello"; - } - @Bean RouteLocator testRoutes(RouteLocatorBuilder builder) { - return builder.routes().route(predicateSpec -> predicateSpec.path("/get").uri(uri)).build(); + return builder.routes().route(r -> r.path("/get").filters(f -> f.prefixPath("/httpbin")).uri(uri)).build(); } }