From e17509648f72f4a5b351f658492f8342d19e3334 Mon Sep 17 00:00:00 2001 From: sgibb Date: Fri, 23 Jun 2023 23:22:17 -0400 Subject: [PATCH] Disables test for jdk 17+ --- .../gateway/filter/WeightCalculatorWebFilterTests.java | 6 +++--- .../WeightRoutePredicateFactoryIntegrationTests.java | 6 +++--- .../predicate/WeightRoutePredicateFactoryYaml404Tests.java | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/WeightCalculatorWebFilterTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/WeightCalculatorWebFilterTests.java index 4ed37d6c..32fbae2f 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/WeightCalculatorWebFilterTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/WeightCalculatorWebFilterTests.java @@ -22,7 +22,8 @@ import java.util.Map; import java.util.Random; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import org.springframework.cloud.gateway.event.PredicateArgsEvent; import org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter.GroupWeightConfig; @@ -34,7 +35,6 @@ import org.springframework.web.server.WebFilterChain; import static java.util.Arrays.asList; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.condition.JRE.JAVA_17; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; @@ -97,7 +97,7 @@ public class WeightCalculatorWebFilterTests { // TODO: modify implementation for testability on JDK17 for Spring 6 @Test - @DisabledOnJre(JAVA_17) + @DisabledForJreRange(min = JRE.JAVA_17) public void testChooseRouteWithRandom() { WeightCalculatorWebFilter filter = createFilter(); filter.addWeightConfig(new WeightConfig("groupa", "route1", 1)); diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryIntegrationTests.java index 8ad1397d..a893948e 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryIntegrationTests.java @@ -20,7 +20,8 @@ import java.util.Random; import java.util.function.Predicate; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -38,14 +39,13 @@ import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.condition.JRE.JAVA_17; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext -@DisabledOnJre(JAVA_17) +@DisabledForJreRange(min = JRE.JAVA_17) public class WeightRoutePredicateFactoryIntegrationTests extends BaseWebClientTests { @Autowired diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryYaml404Tests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryYaml404Tests.java index 3c098ca9..1fbc524d 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryYaml404Tests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryYaml404Tests.java @@ -19,7 +19,8 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.Random; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.DisabledOnJre; +import org.junit.jupiter.api.condition.DisabledForJreRange; +import org.junit.jupiter.api.condition.JRE; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringBootConfiguration; @@ -32,7 +33,6 @@ import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import static org.junit.jupiter.api.condition.JRE.JAVA_17; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -40,7 +40,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @SpringBootTest(webEnvironment = RANDOM_PORT) @ActiveProfiles("weights-404") @DirtiesContext -@DisabledOnJre(JAVA_17) +@DisabledForJreRange(min = JRE.JAVA_17) class WeightRoutePredicateFactoryYaml404Tests extends BaseWebClientTests { @Autowired