Updates to new RetryingTest annotation

This commit is contained in:
spencergibb
2020-07-28 15:02:57 -04:00
parent 2ebaf18431
commit 4d1bc43c1d
4 changed files with 12 additions and 12 deletions

View File

@@ -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 <code>/</code>
* @param matchTrailingSlash set to false if you do not want this path to match when
* there is a trailing <code>/</code>
* @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)));
}
/**

View File

@@ -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();

View File

@@ -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();

View File

@@ -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<ServerWebExchange> predicate = new PathRoutePredicateFactory().apply(config);
Predicate<ServerWebExchange> predicate = new PathRoutePredicateFactory()
.apply(config);
assertThat(predicate.toString()).contains("patternA").contains("patternB")
.contains("true");
}
@EnableAutoConfiguration
@SpringBootConfiguration
@Import(DefaultTestConfig.class)