Browse Source

Disables test for jdk 17+

pull/3066/head
sgibb 1 year ago
parent
commit
e17509648f
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 6
      spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/WeightCalculatorWebFilterTests.java
  2. 6
      spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryIntegrationTests.java
  3. 6
      spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryYaml404Tests.java

6
spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/WeightCalculatorWebFilterTests.java

@ -22,7 +22,8 @@ import java.util.Map; @@ -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; @@ -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 { @@ -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));

6
spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/WeightRoutePredicateFactoryIntegrationTests.java

@ -20,7 +20,8 @@ import java.util.Random; @@ -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; @@ -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

6
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; @@ -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; @@ -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 @@ -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

Loading…
Cancel
Save