From abd126f02ef1f006029217db0ef03013ac026d34 Mon Sep 17 00:00:00 2001 From: spencergibb Date: Tue, 22 Apr 2025 12:52:26 -0400 Subject: [PATCH] Formatting --- .../route/RouteDefinitionRouteLocator.java | 4 ++-- .../predicate/GatewayPredicateVisitorTests.java | 17 +++++++++-------- ...redicatePathContainerAttrBenchMarkTests.java | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/route/RouteDefinitionRouteLocator.java b/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/route/RouteDefinitionRouteLocator.java index c8545c68..aef1a699 100644 --- a/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/route/RouteDefinitionRouteLocator.java +++ b/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/route/RouteDefinitionRouteLocator.java @@ -203,8 +203,8 @@ public class RouteDefinitionRouteLocator implements RouteLocator { } return predicates.stream() - .map(nextPredicate -> lookup(routeDefinition, nextPredicate)) - .reduce(AsyncPredicate.from(exchange -> true), AsyncPredicate::and); + .map(nextPredicate -> lookup(routeDefinition, nextPredicate)) + .reduce(AsyncPredicate.from(exchange -> true), AsyncPredicate::and); } @SuppressWarnings("unchecked") diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/GatewayPredicateVisitorTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/GatewayPredicateVisitorTests.java index c55087fc..c97992ad 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/GatewayPredicateVisitorTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/GatewayPredicateVisitorTests.java @@ -91,13 +91,13 @@ public class GatewayPredicateVisitorTests { PathRoutePredicateFactory pathRoutePredicateFactory = new PathRoutePredicateFactory(webFluxProperties); PathRoutePredicateFactory.Config config = new PathRoutePredicateFactory.Config() - .setPatterns(List.of("/temp/**")) - .setMatchTrailingSlash(true); + .setPatterns(List.of("/temp/**")) + .setMatchTrailingSlash(true); Predicate predicate = pathRoutePredicateFactory.apply(config); - ServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("http://127.0.0.1:8080/gw/api/v1/temp/test") - .build()); + ServerWebExchange exchange = MockServerWebExchange + .from(MockServerHttpRequest.get("http://127.0.0.1:8080/gw/api/v1/temp/test").build()); assertThat(predicate.test(exchange)).isEqualTo(true); } @@ -109,13 +109,13 @@ public class GatewayPredicateVisitorTests { PathRoutePredicateFactory pathRoutePredicateFactory = new PathRoutePredicateFactory(webFluxProperties); PathRoutePredicateFactory.Config config = new PathRoutePredicateFactory.Config() - .setPatterns(List.of("/temp/**")) - .setMatchTrailingSlash(true); + .setPatterns(List.of("/temp/**")) + .setMatchTrailingSlash(true); Predicate predicate = pathRoutePredicateFactory.apply(config); - ServerWebExchange exchange = MockServerWebExchange.from(MockServerHttpRequest.get("http://127.0.0.1:8080/gw/api/v1/temp/test") - .build()); + ServerWebExchange exchange = MockServerWebExchange + .from(MockServerHttpRequest.get("http://127.0.0.1:8080/gw/api/v1/temp/test").build()); assertThat(predicate.test(exchange)).isEqualTo(true); @@ -139,4 +139,5 @@ public class GatewayPredicateVisitorTests { LinkedHashSet uris = webExchange.getRequiredAttribute(GATEWAY_ORIGINAL_REQUEST_URL_ATTR); assertThat(uris).contains(exchange.getRequest().getURI()); } + } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicatePathContainerAttrBenchMarkTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicatePathContainerAttrBenchMarkTests.java index 5fb9a092..a607248b 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicatePathContainerAttrBenchMarkTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicatePathContainerAttrBenchMarkTests.java @@ -55,7 +55,8 @@ public class PathRoutePredicatePathContainerAttrBenchMarkTests { PathRoutePredicateFactory.Config config = new PathRoutePredicateFactory.Config() .setPatterns(Collections.singletonList(PATH_PATTERN_PREFIX + i)) .setMatchTrailingSlash(true); - Predicate predicate = new PathRoutePredicateFactory(new WebFluxProperties()).apply(config); + Predicate predicate = new PathRoutePredicateFactory(new WebFluxProperties()) + .apply(config); predicates.add(predicate); } }