From 1d59ab53f802a88925a3ec95cb9a05fe94137dae Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 9 Aug 2017 10:39:16 -0600 Subject: [PATCH] Fix tests --- .../handler/predicate/PathRoutePredicateFactory.java | 4 ++-- .../filter/factory/HystrixWebFilterFactoryTests.java | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactory.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactory.java index 38f42d4c..455c4538 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactory.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactory.java @@ -30,7 +30,7 @@ import org.springframework.web.util.pattern.PathPatternParser; import static org.springframework.cloud.gateway.handler.support.RoutePredicateFactoryUtils.traceMatch; import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.URI_TEMPLATE_VARIABLES_ATTRIBUTE; -import static org.springframework.http.server.reactive.PathContainer.parsePath; +import static org.springframework.http.server.reactive.PathContainer.parseUrlPath; /** * @author Spencer Gibb @@ -57,7 +57,7 @@ public class PathRoutePredicateFactory implements RoutePredicateFactory { } return exchange -> { - PathContainer path = parsePath(exchange.getRequest().getURI().getPath()); + PathContainer path = parseUrlPath(exchange.getRequest().getURI().getPath()); boolean match = pattern.matches(path); traceMatch("Pattern", pattern.getPatternString(), path, match); diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/HystrixWebFilterFactoryTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/HystrixWebFilterFactoryTests.java index 57568390..94a87fed 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/HystrixWebFilterFactoryTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/HystrixWebFilterFactoryTests.java @@ -69,8 +69,10 @@ public class HystrixWebFilterFactoryTests extends BaseWebClientTests { .exchange(); StepVerifier.create(result) - .expectError() //TODO: can we get more specific as to the error? - .verify(); + .consumeNextWith( + response -> assertStatus(response, HttpStatus.INTERNAL_SERVER_ERROR)) + .expectComplete() + .verify(DURATION); } @EnableAutoConfiguration