From 4d1bc43c1d973efe04a96e57a8d87905f98ce50c Mon Sep 17 00:00:00 2001 From: spencergibb Date: Tue, 28 Jul 2020 15:02:57 -0400 Subject: [PATCH] Updates to new RetryingTest annotation --- .../cloud/gateway/route/builder/PredicateSpec.java | 10 +++++----- ...RequestBodyGatewayFilterFactorySslTimeoutTests.java | 4 ++-- .../filter/ratelimit/RedisRateLimiterTests.java | 4 ++-- .../predicate/PathRoutePredicateFactoryTests.java | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/PredicateSpec.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/PredicateSpec.java index 3c715f8c3..f159679c4 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/PredicateSpec.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/builder/PredicateSpec.java @@ -185,14 +185,14 @@ public class PredicateSpec extends UriSpec { * A predicate that checks if the path of the request matches the given pattern * @param patterns the pattern to check the path against. The pattern is a * {@link org.springframework.util.PathMatcher} pattern - * @param matchTrailingSlash set to false if you do not want this path to - * match when there is a trailing / + * @param matchTrailingSlash set to false if you do not want this path to match when + * there is a trailing / * @return a {@link BooleanSpec} to be used to add logical operators */ public BooleanSpec path(boolean matchTrailingSlash, String... patterns) { - return asyncPredicate(getBean(PathRoutePredicateFactory.class).applyAsync(c -> c - .setPatterns(Arrays.asList(patterns)) - .setMatchTrailingSlash(matchTrailingSlash))); + return asyncPredicate(getBean(PathRoutePredicateFactory.class) + .applyAsync(c -> c.setPatterns(Arrays.asList(patterns)) + .setMatchTrailingSlash(matchTrailingSlash))); } /** diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java index a3af008ee..927bb1cfd 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java @@ -26,7 +26,7 @@ import io.netty.handler.ssl.util.InsecureTrustManagerFactory; import io.netty.util.internal.PlatformDependent; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junitpioneer.jupiter.RepeatFailedTest; +import org.junitpioneer.jupiter.RetryingTest; import reactor.core.publisher.Mono; import reactor.netty.http.client.HttpClient; @@ -94,7 +94,7 @@ public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests .jsonPath("message").isEqualTo("handshake timed out after 1ms"); } - @RepeatFailedTest(3) + @RetryingTest(3) public void modifyRequestBodyRelease() { releaseCount.set(0); // long initialUsedDirectMemory = PlatformDependent.usedDirectMemory(); diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiterTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiterTests.java index db1f3a544..9e73eea2c 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiterTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/filter/ratelimit/RedisRateLimiterTests.java @@ -21,7 +21,7 @@ import java.util.UUID; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import org.junitpioneer.jupiter.RepeatFailedTest; +import org.junitpioneer.jupiter.RetryingTest; import org.testcontainers.containers.GenericContainer; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; @@ -71,7 +71,7 @@ public class RedisRateLimiterTests extends BaseWebClientTests { rateLimiter.setIncludeHeaders(true); } - @RepeatFailedTest(3) + @RetryingTest(3) public void redisRateLimiterWorks() throws Exception { String id = UUID.randomUUID().toString(); diff --git a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java index 21065852d..5e9922842 100644 --- a/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-core/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java @@ -105,7 +105,7 @@ public class PathRoutePredicateFactoryTests extends BaseWebClientTests { .setMatchOptionalTrailingSeparator(false); assertThat(config.isMatchTrailingSlash()).isEqualTo(false); } - + @Test public void toStringFormat() { Config config = new Config().setPatterns(Arrays.asList("patternA", "patternB")) @@ -119,12 +119,12 @@ public class PathRoutePredicateFactoryTests extends BaseWebClientTests { public void toStringFormatMatchTrailingSlashTrue() { Config config = new Config().setPatterns(Arrays.asList("patternA", "patternB")) .setMatchTrailingSlash(true); - Predicate predicate = new PathRoutePredicateFactory().apply(config); + Predicate predicate = new PathRoutePredicateFactory() + .apply(config); assertThat(predicate.toString()).contains("patternA").contains("patternB") .contains("true"); } - @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class)