From 5e746e4f3d9f17ed0b5e4ff520eed179b53d4409 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Mon, 20 Sep 2021 14:50:54 +0200 Subject: [PATCH 1/8] 3.0.x jdk17 (#2372) --- .../cloud/gateway/cors/CorsTests.java | 5 +-- .../cors/SimpleUrlHandlerCorsTests.java | 5 +-- .../GatewayMetricsFilterCustomTagsTests.java | 13 +++----- .../filter/GatewayMetricsFilterTests.java | 5 +-- .../NettyRoutingFilterCompatibleTests.java | 13 +++----- .../NettyRoutingFilterIntegrationTests.java | 5 +-- .../filter/NettyRoutingFilterTests.java | 31 +++++++++---------- .../WeightCalculatorWebFilterTests.java | 6 +++- ...equestHeaderGatewayFilterFactoryTests.java | 5 +-- ...estParameterGatewayFilterFactoryTests.java | 5 +-- ...sponseHeaderGatewayFilterFactoryTests.java | 15 ++++----- ...sponseHeaderGatewayFilterFactoryTests.java | 11 +++---- ...equestHeaderGatewayFilterFactoryTests.java | 23 ++++++-------- ...veHostHeaderGatewayFilterFactoryTests.java | 5 +-- .../RedirectToGatewayFilterFactoryTests.java | 5 +-- ...equestHeaderGatewayFilterFactoryTests.java | 5 +-- ...rGatewayFilterFactoryIntegrationTests.java | 5 +-- ...sponseHeaderGatewayFilterFactoryTests.java | 5 +-- ...estHeaderSizeGatewayFilterFactoryTest.java | 5 +-- ...iGatewayFilterFactoryIntegrationTests.java | 11 +++---- ...tRateLimiterGatewayFilterFactoryTests.java | 5 +-- .../RequestSizeGatewayFilterFactoryTest.java | 5 +-- ...yGatewayFilterFactoryIntegrationTests.java | 24 ++++++-------- ...sponseHeaderGatewayFilterFactoryTests.java | 5 +-- ...hGatewayFilterFactoryIntegrationTests.java | 5 +-- ...sponseHeaderGatewayFilterFactoryTests.java | 5 +-- .../SaveSessionGatewayFilterFactoryTests.java | 5 +-- ...ecureHeadersGatewayFilterFactoryTests.java | 5 +-- ...hGatewayFilterFactoryIntegrationTests.java | 5 +-- ...equestHeaderGatewayFilterFactoryTests.java | 5 +-- ...stHostHeaderGatewayFilterFactoryTests.java | 5 +-- ...sponseHeaderGatewayFilterFactoryTests.java | 5 +-- .../SetStatusGatewayFilterFactoryTests.java | 5 +-- ...CloudCircuitBreakerFilterFactoryTests.java | 2 +- ...BreakerResilience4JFilterFactoryTests.java | 5 +-- ...xGatewayFilterFactoryIntegrationTests.java | 5 +-- ...dyGatewayFilterFactorySslTimeoutTests.java | 16 +++++----- ...yRequestBodyGatewayFilterFactoryTests.java | 5 +-- ...onseBodyGatewayFilterFactoryGzipTests.java | 13 +++----- ...ResponseBodyGatewayFilterFactoryTests.java | 5 +-- ...ttpStatusInResponseHeadersFilterTests.java | 5 +-- .../NonStandardHeadersInResponseTests.java | 5 +-- ...ateHandlerMappingEmptyPredicatesTests.java | 5 +-- ...edicateHandlerMappingIntegrationTests.java | 13 +++----- ...ingSameManagementPortIntegrationTests.java | 13 +++----- ...RoutePredicateFactoryIntegrationTests.java | 5 +-- ...RoutePredicateFactoryIntegrationTests.java | 5 +-- ...RoutePredicateFactoryIntegrationTests.java | 13 +++----- .../CookieRoutePredicateFactoryTests.java | 2 +- .../HeaderRoutePredicateFactoryTests.java | 5 +-- .../HostRoutePredicateFactoryTests.java | 5 +-- .../MethodRoutePredicateFactoryTests.java | 5 +-- .../PathRoutePredicateFactoryTests.java | 5 +-- .../QueryRoutePredicateFactoryTests.java | 24 ++++++-------- .../RemoteAddrRoutePredicateFactoryTests.java | 5 +-- ...RoutePredicateFactoryIntegrationTests.java | 8 ++--- ...ightRoutePredicateFactoryYaml404Tests.java | 16 +++++----- .../gateway/test/BaseWebClientTests.java | 4 +-- .../test/CustomBlockHoundIntegration.java | 5 +++ .../gateway/test/FormIntegrationTests.java | 15 ++++----- .../gateway/test/GatewayIntegrationTests.java | 29 ++++++++--------- .../cloud/gateway/test/HttpStatusTests.java | 17 +++++----- .../cloud/gateway/test/PostTests.java | 11 +++---- .../test/ssl/ClientCertAuthSSLTests.java | 9 ++---- .../gateway/test/ssl/MultiCertSSLTests.java | 4 --- .../test/ssl/SSLHandshakeTimeoutTests.java | 5 +-- .../gateway/test/ssl/SingleCertSSLTests.java | 9 ++---- 67 files changed, 197 insertions(+), 368 deletions(-) diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/CorsTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/CorsTests.java index 9d3bee78..b722127c 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/CorsTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/CorsTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.cors; import java.util.Arrays; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.boot.SpringBootConfiguration; @@ -32,13 +31,11 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.client.ClientResponse; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class CorsTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/SimpleUrlHandlerCorsTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/SimpleUrlHandlerCorsTests.java index f986ee1f..7a6427ec 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/SimpleUrlHandlerCorsTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/cors/SimpleUrlHandlerCorsTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.cors; import java.util.Arrays; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.boot.SpringBootConfiguration; @@ -34,13 +33,11 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.client.ClientResponse; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = "spring.cloud.gateway.globalcors.add-to-simple-url-handler-mapping=true") @DirtiesContext diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterCustomTagsTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterCustomTagsTests.java index 51e71c38..31b705c4 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterCustomTagsTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterCustomTagsTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.filter; import io.micrometer.core.instrument.MeterRegistry; import io.micrometer.core.instrument.Tags; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -33,7 +32,6 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -42,10 +40,9 @@ import static org.springframework.cloud.gateway.config.GatewayMetricsProperties. /** * @author Ingyu Hwang */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext -public class GatewayMetricsFilterCustomTagsTests extends BaseWebClientTests { +class GatewayMetricsFilterCustomTagsTests extends BaseWebClientTests { private static final String REQUEST_METRICS_NAME = DEFAULT_PREFIX + ".requests"; @@ -56,7 +53,7 @@ public class GatewayMetricsFilterCustomTagsTests extends BaseWebClientTests { private String testUri; @Test - public void gatewayRequestsMeterFilterHasCustomTags() { + void gatewayRequestsMeterFilterHasCustomTags() { testClient.get().uri("/headers").exchange().expectStatus().isOk(); // default tags @@ -79,10 +76,10 @@ public class GatewayMetricsFilterCustomTagsTests extends BaseWebClientTests { @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class CustomConfig { + static class CustomConfig { @Bean - public GatewayTagsProvider customGatewayTagsProvider() { + GatewayTagsProvider customGatewayTagsProvider() { return exchange -> Tags.of("custom1", "tag1", "custom2", "tag2"); } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterTests.java index e2ed2ab7..a75c89d0 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/GatewayMetricsFilterTests.java @@ -17,8 +17,7 @@ package org.springframework.cloud.gateway.filter; import io.micrometer.core.instrument.MeterRegistry; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -37,7 +36,6 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -45,7 +43,6 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.cloud.gateway.config.GatewayMetricsProperties.DEFAULT_PREFIX; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class GatewayMetricsFilterTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterCompatibleTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterCompatibleTests.java index bde33d62..d2c65518 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterCompatibleTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterCompatibleTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -27,7 +26,6 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.server.ServerWebExchange; import static org.assertj.core.api.Assertions.assertThat; @@ -41,7 +39,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen * * @author echooymxq **/ -@RunWith(SpringRunner.class) @SpringBootTest(properties = { "spring.cloud.gateway.routes[0].id=route_connect_timeout", "spring.cloud.gateway.routes[0].uri=http://localhost:32167", "spring.cloud.gateway.routes[0].predicates[0].name=Path", @@ -53,16 +50,16 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen "spring.cloud.gateway.routes[1].filters[0]=StripPrefix=1", "spring.cloud.gateway.routes[1].metadata.response-timeout=1000" }, webEnvironment = RANDOM_PORT) @DirtiesContext -public class NettyRoutingFilterCompatibleTests extends BaseWebClientTests { +class NettyRoutingFilterCompatibleTests extends BaseWebClientTests { @Test - public void shouldApplyConnectTimeoutPerRoute() { + void shouldApplyConnectTimeoutPerRoute() { assertThat(NettyRoutingFilter.getInteger("5")).isEqualTo(5); assertThat(NettyRoutingFilter.getInteger(5)).isEqualTo(5); } @Test - public void shouldApplyResponseTimeoutPerRoute() { + void shouldApplyResponseTimeoutPerRoute() { testClient.get().uri("/route/delay/2").exchange().expectStatus().isEqualTo(HttpStatus.GATEWAY_TIMEOUT) .expectBody().jsonPath("$.status").isEqualTo(String.valueOf(HttpStatus.GATEWAY_TIMEOUT.value())) .jsonPath("$.message").isEqualTo("Response took longer than timeout: PT1S"); @@ -71,7 +68,7 @@ public class NettyRoutingFilterCompatibleTests extends BaseWebClientTests { @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterIntegrationTests.java index de965257..f86a0219 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterIntegrationTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; @@ -33,7 +32,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.server.reactive.ServerHttpResponse; import org.springframework.http.server.reactive.ServerHttpResponseDecorator; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.web.server.ServerWebExchange; @@ -43,7 +41,6 @@ import static org.hamcrest.Matchers.allOf; import static org.hamcrest.Matchers.containsString; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(properties = "spring.cloud.gateway.httpclient.response-timeout=3s", webEnvironment = RANDOM_PORT) @DirtiesContext public class NettyRoutingFilterIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterTests.java index ddde7dcb..0415c332 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/NettyRoutingFilterTests.java @@ -17,11 +17,9 @@ package org.springframework.cloud.gateway.filter; import org.hamcrest.Matchers; -import org.junit.Assert; -import org.junit.BeforeClass; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.netty.DisposableServer; import reactor.netty.http.server.HttpServer; @@ -37,33 +35,34 @@ import org.springframework.cloud.gateway.test.PermitAllSecurityConfiguration; import org.springframework.context.ApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.util.SocketUtils; -@RunWith(SpringRunner.class) +import static org.assertj.core.api.Assertions.assertThat; + @SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) -public class NettyRoutingFilterTests extends BaseWebClientTests { +class NettyRoutingFilterTests extends BaseWebClientTests { private static int port; @Autowired private ApplicationContext context; - @BeforeClass + @BeforeAll public static void beforeAll() { port = SocketUtils.findAvailableTcpPort(); } @Test - @Ignore - public void mockServerWorks() { + @Disabled + void mockServerWorks() { WebTestClient client = WebTestClient.bindToApplicationContext(this.context).build(); client.get().uri("/mockexample").exchange().expectStatus().value(Matchers.lessThan(500)); } - @Test // gh-2207 - public void testCaseInsensitiveScheme() { + @Test + // gh-2207 + void testCaseInsensitiveScheme() { DisposableServer server = HttpServer.create().port(port).host("127.0.0.1").route( routes -> routes.get("/issue", (request, response) -> response.sendString(Mono.just("issue2207")))) .bindNow(); @@ -71,10 +70,10 @@ public class NettyRoutingFilterTests extends BaseWebClientTests { try { testClient.get().uri("/issue").exchange().expectStatus().isOk().expectBody() .consumeWith(entityExchangeResult -> { - Assert.assertNotNull(entityExchangeResult); - Assert.assertNotNull(entityExchangeResult.getResponseBody()); + assertThat(entityExchangeResult).isNotNull(); + assertThat(entityExchangeResult.getResponseBody()).isNotNull(); String content = new String(entityExchangeResult.getResponseBody()); - Assert.assertEquals("issue2207", content); + assertThat(content).isEqualTo("issue2207"); }); } finally { 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 7770e975..892b339f 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.jetbrains.annotations.NotNull; -import org.junit.Test; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnJre; import org.springframework.cloud.gateway.event.PredicateArgsEvent; import org.springframework.cloud.gateway.filter.WeightCalculatorWebFilter.GroupWeightConfig; @@ -34,6 +35,7 @@ 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; @@ -95,7 +97,9 @@ public class WeightCalculatorWebFilterTests { return "route" + i; } + // TODO: modify implementation for testability on JDK17 for Spring 6 @Test + @DisabledOnJre(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/filter/factory/AddRequestHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestHeaderGatewayFilterFactoryTests.java index f2e3a1b2..4e50b2ab 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestHeaderGatewayFilterFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.Arrays; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -35,7 +34,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -45,7 +43,6 @@ import static org.springframework.cloud.gateway.test.TestUtils.getMap; * @author Spencer Gibb * @author Biju Kunjummen */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles(profiles = "request-header-web-filter") diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestParameterGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestParameterGatewayFilterFactoryTests.java index f1332961..cdd5b089 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestParameterGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddRequestParameterGatewayFilterFactoryTests.java @@ -21,8 +21,7 @@ import java.net.URI; import java.net.URLDecoder; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -37,7 +36,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.util.UriComponentsBuilder; import static org.assertj.core.api.Assertions.assertThat; @@ -45,7 +43,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.containsEncodedParts; import static org.springframework.cloud.gateway.test.TestUtils.getMap; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles(profiles = "request-parameter-web-filter") diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddResponseHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddResponseHeaderGatewayFilterFactoryTests.java index e050d35f..bc60ec68 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddResponseHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/AddResponseHeaderGatewayFilterFactoryTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.net.URI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -33,19 +32,17 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.util.UriComponentsBuilder; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext -public class AddResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { +class AddResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { @Test - public void testResposneHeaderFilter() { + void testResposneHeaderFilter() { URI uri = UriComponentsBuilder.fromUriString(this.baseUri + "/headers").build(true).toUri(); String host = "www.addresponseheader.org"; String expectedValue = "Bar"; @@ -54,7 +51,7 @@ public class AddResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTes } @Test - public void testResposneHeaderFilterJavaDsl() { + void testResposneHeaderFilterJavaDsl() { URI uri = UriComponentsBuilder.fromUriString(this.baseUri + "/get").build(true).toUri(); String host = "www.addresponseheaderjava.org"; String expectedValue = "myresponsevalue-www"; @@ -62,7 +59,7 @@ public class AddResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTes } @Test - public void toStringFormat() { + void toStringFormat() { NameValueConfig config = new NameValueConfig().setName("myname").setValue("myvalue"); GatewayFilter filter = new AddResponseHeaderGatewayFilterFactory().apply(config); assertThat(filter.toString()).contains("myname").contains("myvalue"); @@ -71,7 +68,7 @@ public class AddResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTes @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { @Value("${test.uri}") String uri; diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/DedupeResponseHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/DedupeResponseHeaderGatewayFilterFactoryTests.java index 75d268f6..4179fceb 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/DedupeResponseHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/DedupeResponseHeaderGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,17 +24,15 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext -public class DedupeResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { +class DedupeResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { @Test - public void dedupeResponseHeaderFilterWorks() { + void dedupeResponseHeaderFilterWorks() { testClient.get().uri("/headers").header("Host", "www.deduperesponseheader.org").exchange().expectStatus().isOk() .expectHeader().valueEquals("Access-Control-Allow-Credentials", "true").expectHeader() .valueEquals("Access-Control-Allow-Origin", "https://musk.mars").expectHeader() @@ -46,7 +43,7 @@ public class DedupeResponseHeaderGatewayFilterFactoryTests extends BaseWebClient @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/MapRequestHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/MapRequestHeaderGatewayFilterFactoryTests.java index e9b836e3..65aed5be 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/MapRequestHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/MapRequestHeaderGatewayFilterFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.List; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -35,7 +34,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -44,14 +42,13 @@ import static org.springframework.cloud.gateway.test.TestUtils.getMap; /** * @author Tony Clarke */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles(profiles = "request-map-header-web-filter") -public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTests { +class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTests { @Test - public void mapRequestHeaderFilterWorks() { + void mapRequestHeaderFilterWorks() { testClient.get().uri("/headers").header("Host", "www.maprequestheader.org").header("a", "tome").exchange() .expectBody(Map.class).consumeWith(result -> { Map headers = getMap(result.getResponseBody(), "headers"); @@ -60,7 +57,7 @@ public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTest } @Test - public void mapRequestHeaderFilterWorksJavaDsl() { + void mapRequestHeaderFilterWorksJavaDsl() { testClient.get().uri("/headers").header("Host", "www.maprequestheaderjava.org").header("b", "tome").exchange() .expectBody(Map.class).consumeWith(result -> { Map headers = getMap(result.getResponseBody(), "headers"); @@ -70,7 +67,7 @@ public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTest @SuppressWarnings("unchecked") @Test - public void mapRequestHeaderWithMultiValueFilterWorks() { + void mapRequestHeaderWithMultiValueFilterWorks() { testClient.get().uri("/multivalueheaders").header("Host", "www.maprequestheader.org") .header("a", "tome", "toyou").exchange().expectBody(Map.class).consumeWith(result -> { Map headers = getMap(result.getResponseBody(), "headers"); @@ -81,7 +78,7 @@ public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTest } @Test - public void mapRequestHeaderWithNullValueFilterWorks() { + void mapRequestHeaderWithNullValueFilterWorks() { testClient.get().uri("/headers").header("Host", "www.maprequestheader.org").header("a", (String) null) .exchange().expectBody(Map.class).consumeWith(result -> { Map headers = getMap(result.getResponseBody(), "headers"); @@ -90,7 +87,7 @@ public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTest } @Test - public void mapRequestHeaderWhenInputHeaderDoesNotExist() { + void mapRequestHeaderWhenInputHeaderDoesNotExist() { testClient.get().uri("/headers").header("Host", "www.maprequestheader.org").exchange().expectBody(Map.class) .consumeWith(result -> { Map headers = getMap(result.getResponseBody(), "headers"); @@ -99,7 +96,7 @@ public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTest } @Test - public void toStringFormat() { + void toStringFormat() { Config config = new Config().setFromHeader("myfromheader").setToHeader("mytoheader"); GatewayFilter filter = new MapRequestHeaderGatewayFilterFactory().apply(config); assertThat(filter.toString()).contains("myfromheader").contains("mytoheader"); @@ -108,13 +105,13 @@ public class MapRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTest @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { @Value("${test.uri}") String uri; @Bean - public RouteLocator testRouteLocator(RouteLocatorBuilder builder) { + RouteLocator testRouteLocator(RouteLocatorBuilder builder) { return builder.routes().route("map_request_header_java_test", r -> r.path("/headers").and().host("**.maprequestheaderjava.org") .filters(f -> f.prefixPath("/httpbin").mapRequestHeader("b", "X-Request-Example-Java")) diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/PreserveHostHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/PreserveHostHeaderGatewayFilterFactoryTests.java index c1c8e959..710f76e0 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/PreserveHostHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/PreserveHostHeaderGatewayFilterFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.List; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -33,7 +32,6 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -42,7 +40,6 @@ import static org.springframework.cloud.gateway.test.TestUtils.getMap; /** * @author Spencer Gibb */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class PreserveHostHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RedirectToGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RedirectToGatewayFilterFactoryTests.java index d9e5e0b5..d23f4965 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RedirectToGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RedirectToGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -32,12 +31,10 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RedirectToGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestHeaderGatewayFilterFactoryTests.java index 349e753a..0da13c06 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestHeaderGatewayFilterFactoryTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -29,13 +28,11 @@ import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFac import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.cloud.gateway.test.TestUtils.getMap; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RemoveRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestParameterGatewayFilterFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestParameterGatewayFilterFactoryIntegrationTests.java index 8851ccf9..a067e12b 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestParameterGatewayFilterFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveRequestParameterGatewayFilterFactoryIntegrationTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -33,13 +32,11 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.cloud.gateway.test.TestUtils.getMap; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RemoveRequestParameterGatewayFilterFactoryIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveResponseHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveResponseHeaderGatewayFilterFactoryTests.java index 010237cd..05a0fc4d 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveResponseHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RemoveResponseHeaderGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -27,12 +26,10 @@ import org.springframework.cloud.gateway.filter.factory.AbstractGatewayFilterFac import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RemoveResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java index a5b0d4ea..c0dcf5d9 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderSizeGatewayFilterFactoryTest.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -32,7 +31,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.unit.DataSize; import org.springframework.util.unit.DataUnit; @@ -43,7 +41,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen * @author Sakalya Deshpande */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RequestHeaderSizeGatewayFilterFactoryTest extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests.java index 59d784d1..315f921c 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests.java @@ -20,9 +20,8 @@ import java.net.URI; import java.util.Optional; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Ignore; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -34,7 +33,6 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -42,7 +40,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen /** * @author Toshiaki Maki */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests extends BaseWebClientTests { @@ -51,7 +48,7 @@ public class RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests exten int port; @Test - @Ignore + @Disabled public void changeUriWorkWithProperties() { testClient.get().uri("/").header("Host", "www.changeuri.org") .header("X-CF-Forwarded-Url", "http://localhost:" + port + "/actuator/health").exchange() @@ -59,7 +56,7 @@ public class RequestHeaderToRequestUriGatewayFilterFactoryIntegrationTests exten } @Test - @Ignore + @Disabled public void changeUriWorkWithDsl() { testClient.get().uri("/").header("Host", "www.changeuri.org") .header("X-Next-Url", "http://localhost:" + port + "/actuator/health").exchange() diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactoryTests.java index 32d4b272..8f7b825b 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestRateLimiterGatewayFilterFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.Collections; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; @@ -45,7 +44,6 @@ import org.springframework.http.HttpStatus; import org.springframework.mock.http.server.reactive.MockServerHttpRequest; import org.springframework.mock.web.server.MockServerWebExchange; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.Mockito.when; @@ -57,7 +55,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen * * @author Spencer Gibb */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RequestRateLimiterGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestSizeGatewayFilterFactoryTest.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestSizeGatewayFilterFactoryTest.java index 2c3b7f2a..2dd2adc3 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestSizeGatewayFilterFactoryTest.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RequestSizeGatewayFilterFactoryTest.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -32,7 +31,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.unit.DataSize; import static org.assertj.core.api.Assertions.assertThat; @@ -42,7 +40,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen * @author Arpan Das */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RequestSizeGatewayFilterFactoryTest extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java index 10a560b9..16b9ad8d 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RetryGatewayFilterFactoryIntegrationTests.java @@ -25,16 +25,16 @@ import java.util.concurrent.atomic.AtomicInteger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hamcrest.CoreMatchers; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.system.OutputCaptureRule; +import org.springframework.boot.test.system.CapturedOutput; +import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.boot.web.server.LocalServerPort; import org.springframework.cloud.client.DefaultServiceInstance; import org.springframework.cloud.gateway.filter.GatewayFilter; @@ -53,7 +53,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -62,7 +61,6 @@ import org.springframework.web.bind.annotation.RestController; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = { "spring.cloud.gateway.httpclient.connect-timeout=500", "spring.cloud.gateway.httpclient.response-timeout=2s", @@ -72,11 +70,9 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen // https://github.com/spring-cloud/spring-cloud-gateway/issues/1315, // so we use only PrefixPath filter @ActiveProfiles("retrytests") +@ExtendWith(OutputCaptureExtension.class) public class RetryGatewayFilterFactoryIntegrationTests extends BaseWebClientTests { - @Rule - public final OutputCaptureRule capture = new OutputCaptureRule(); - @Test public void retryFilterGet() { testClient.get().uri("/retry?key=get").exchange().expectStatus().isOk().expectBody(String.class).isEqualTo("3"); @@ -110,11 +106,11 @@ public class RetryGatewayFilterFactoryIntegrationTests extends BaseWebClientTest } @Test - public void retryFilterPost() { + public void retryFilterPost(CapturedOutput output) { testClient.post().uri("/retrypost?key=postconfig&expectedbody=HelloConfig") .header(HttpHeaders.HOST, "www.retrypostconfig.org").bodyValue("HelloConfig").exchange().expectStatus() .isOk().expectBody(String.class).isEqualTo("3"); - assertThat(this.capture.toString()).contains("disposing response connection before next iteration"); + assertThat(output).contains("disposing response connection before next iteration"); } @Test @@ -124,12 +120,12 @@ public class RetryGatewayFilterFactoryIntegrationTests extends BaseWebClientTest } @Test - public void retryFilterPostOneTime() { + public void retryFilterPostOneTime(CapturedOutput output) { testClient.post().uri("/retrypost?key=retryFilterPostOneTime&expectedbody=HelloGateway&count=1") .header(HttpHeaders.HOST, "www.retrypostonceconfig.org").bodyValue("HelloGateway").exchange() .expectStatus().isOk(); - assertThat(this.capture.toString()).contains("setting new iteration in attr 0"); - assertThat(this.capture.toString()).doesNotContain("setting new iteration in attr 1"); + assertThat(output).contains("setting new iteration in attr 0"); + assertThat(output).doesNotContain("setting new iteration in attr 1"); } @Test diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteLocationResponseHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteLocationResponseHeaderGatewayFilterFactoryTests.java index 01345eca..318a1033 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteLocationResponseHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteLocationResponseHeaderGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,11 +24,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RewriteLocationResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewritePathGatewayFilterFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewritePathGatewayFilterFactoryIntegrationTests.java index 0aa27cdf..414c61a5 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewritePathGatewayFilterFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewritePathGatewayFilterFactoryIntegrationTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,11 +24,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RewritePathGatewayFilterFactoryIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteResponseHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteResponseHeaderGatewayFilterFactoryTests.java index 6451620e..db65493f 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteResponseHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/RewriteResponseHeaderGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,11 +24,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class RewriteResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SaveSessionGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SaveSessionGatewayFilterFactoryTests.java index 5de82d62..74c7aab1 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SaveSessionGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SaveSessionGatewayFilterFactoryTests.java @@ -20,8 +20,7 @@ import java.time.Duration; import java.util.HashMap; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -34,7 +33,6 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.server.WebSession; import org.springframework.web.server.session.WebSessionManager; @@ -47,7 +45,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen /** * @author Greg Turnquist */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles(profiles = "save-session-web-filter") diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactoryTests.java index 8049416b..c2886f74 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SecureHeadersGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -30,7 +29,6 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.client.ClientResponse; import static org.assertj.core.api.Assertions.assertThat; @@ -45,7 +43,6 @@ import static org.springframework.cloud.gateway.filter.factory.SecureHeadersGate import static org.springframework.cloud.gateway.filter.factory.SecureHeadersGatewayFilterFactory.X_XSS_PROTECTION_HEADER; import static org.springframework.cloud.gateway.test.TestUtils.assertStatus; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class SecureHeadersGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetPathGatewayFilterFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetPathGatewayFilterFactoryIntegrationTests.java index 1fc0c78b..c58a57c6 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetPathGatewayFilterFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetPathGatewayFilterFactoryIntegrationTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,11 +24,9 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class SetPathGatewayFilterFactoryIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHeaderGatewayFilterFactoryTests.java index fb3fd1f1..f3386d34 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHeaderGatewayFilterFactoryTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -33,7 +32,6 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -43,7 +41,6 @@ import static org.springframework.cloud.gateway.test.TestUtils.getMap; * @author Spencer Gibb * @author Biju Kunjummen */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class SetRequestHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHostHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHostHeaderGatewayFilterFactoryTests.java index 19ba6a1e..416f9ec0 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHostHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetRequestHostHeaderGatewayFilterFactoryTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.filter.factory; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -28,13 +27,11 @@ import org.springframework.cloud.gateway.filter.GatewayFilter; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.cloud.gateway.test.TestUtils.getMap; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class SetRequestHostHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetResponseHeaderGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetResponseHeaderGatewayFilterFactoryTests.java index a31e15ee..8f72d577 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetResponseHeaderGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetResponseHeaderGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -31,12 +30,10 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class SetResponseHeaderGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetStatusGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetStatusGatewayFilterFactoryTests.java index 3ab2ee7f..59c46287 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetStatusGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SetStatusGatewayFilterFactoryTests.java @@ -17,8 +17,7 @@ package org.springframework.cloud.gateway.filter.factory; import org.hamcrest.Matchers; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -39,13 +38,11 @@ import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.WebTestClient; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class SetStatusGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerFilterFactoryTests.java index dfd32e63..0923348f 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerFilterFactoryTests.java @@ -16,7 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.http.HttpStatus; diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerResilience4JFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerResilience4JFilterFactoryTests.java index bb201e41..bdda74aa 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerResilience4JFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerResilience4JFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringBootConfiguration; @@ -34,7 +33,6 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.BodyInserters; @@ -45,7 +43,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen /** * @author Ryan Baxter */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = { "debug=true", "spring.cloud.circuitbreaker.hystrix.enabled=false" }) @ContextConfiguration(classes = SpringCloudCircuitBreakerResilience4JFilterFactoryTests.Config.class) diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/StripPrefixGatewayFilterFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/StripPrefixGatewayFilterFactoryIntegrationTests.java index dc9bb966..cb81dfd9 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/StripPrefixGatewayFilterFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/StripPrefixGatewayFilterFactoryIntegrationTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,14 +24,12 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; /** * @author Ryan Baxter */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class StripPrefixGatewayFilterFactoryIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java index 6c25e6eb..14c7aa70 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactorySslTimeoutTests.java @@ -63,7 +63,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen "spring.main.allow-bean-definition-overriding=true" }) @DirtiesContext @ActiveProfiles("single-cert-ssl") -public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWebClientTests { +class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWebClientTests { @Autowired AtomicInteger releaseCount; @@ -82,7 +82,7 @@ public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWe } @Test - public void modifyRequestBodySSLTimeout() { + void modifyRequestBodySSLTimeout() { testClient.post().uri("/post").header("Host", "www.modifyrequestbodyssltimeout.org") .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML_VALUE) .body(BodyInserters.fromValue("request")).exchange().expectStatus() @@ -91,7 +91,7 @@ public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWe } @RetryingTest(3) - public void modifyRequestBodyRelease() { + void modifyRequestBodyRelease() { releaseCount.set(0); // long initialUsedDirectMemory = PlatformDependent.usedDirectMemory(); for (int i = 0; i < 10; i++) { @@ -107,7 +107,7 @@ public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWe } @Test - public void modifyRequestBodyHappenedError() { + void modifyRequestBodyHappenedError() { testClient.post().uri("/post").header("Host", "www.modifyrequestbodyexception.org") .header(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_XML_VALUE) .body(BodyInserters.fromValue("request")).exchange().expectStatus() @@ -118,14 +118,14 @@ public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWe @EnableAutoConfiguration @SpringBootConfiguration(proxyBeanMethods = false) @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { @Value("${test.uri}") String uri; @Bean @DependsOn("testModifyRequestBodyGatewayFilterFactory") - public RouteLocator testRouteLocator(RouteLocatorBuilder builder) { + RouteLocator testRouteLocator(RouteLocatorBuilder builder) { return builder.routes() .route("test_modify_request_body_ssl_timeout", r -> r.order(-1).host("**.modifyrequestbodyssltimeout.org") @@ -146,13 +146,13 @@ public class ModifyRequestBodyGatewayFilterFactorySslTimeoutTests extends BaseWe } @Bean - public AtomicInteger count() { + AtomicInteger count() { return new AtomicInteger(); } @Bean @Primary - public ModifyRequestBodyGatewayFilterFactory testModifyRequestBodyGatewayFilterFactory( + ModifyRequestBodyGatewayFilterFactory testModifyRequestBodyGatewayFilterFactory( ServerCodecConfigurer codecConfigurer, AtomicInteger count) { return new ModifyRequestBodyGatewayFilterFactory(codecConfigurer.getReaders()) { @Override diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactoryTests.java index 4fd7660e..90fd2917 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyRequestBodyGatewayFilterFactoryTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.factory.rewrite; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Value; @@ -33,7 +32,6 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.BodyInserters; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -41,7 +39,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen /** * @author Junghoon Song */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = "spring.codec.max-in-memory-size=13") @DirtiesContext public class ModifyRequestBodyGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryGzipTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryGzipTests.java index 4962b965..6c871771 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryGzipTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryGzipTests.java @@ -20,8 +20,7 @@ import java.net.URI; import java.util.HashMap; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Value; @@ -35,18 +34,16 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.util.UriComponentsBuilder; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext -public class ModifyResponseBodyGatewayFilterFactoryGzipTests extends BaseWebClientTests { +class ModifyResponseBodyGatewayFilterFactoryGzipTests extends BaseWebClientTests { @Test - public void testModificationOfResponseBody() { + void testModificationOfResponseBody() { URI uri = UriComponentsBuilder.fromUriString(this.baseUri + "/gzip").build(true).toUri(); testClient.get().uri(uri).header("Host", "www.modifyresponsebodyjava.org").accept(MediaType.APPLICATION_JSON) @@ -56,13 +53,13 @@ public class ModifyResponseBodyGatewayFilterFactoryGzipTests extends BaseWebClie @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { @Value("${test.uri}") String uri; @Bean - public RouteLocator testRouteLocator(RouteLocatorBuilder builder) { + RouteLocator testRouteLocator(RouteLocatorBuilder builder) { return builder.routes().route("modify_response_java_test_gzip", r -> r.path("/gzip").and() .host("www.modifyresponsebodyjava.org") .filters(f -> f.modifyResponseBody(String.class, Map.class, (webExchange, originalResponse) -> { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryTests.java index 0b71e286..6db20d0b 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/rewrite/ModifyResponseBodyGatewayFilterFactoryTests.java @@ -20,8 +20,7 @@ import java.net.URI; import java.util.HashMap; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Value; @@ -37,13 +36,11 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.BodyInserters; import org.springframework.web.util.UriComponentsBuilder; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = "spring.codec.max-in-memory-size=40") @DirtiesContext public class ModifyResponseBodyGatewayFilterFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/HttpStatusInResponseHeadersFilterTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/HttpStatusInResponseHeadersFilterTests.java index 5909321c..5338b1f9 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/HttpStatusInResponseHeadersFilterTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/HttpStatusInResponseHeadersFilterTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.filter.headers; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -28,7 +27,6 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.server.ServerWebExchange; import static org.assertj.core.api.Assertions.assertThat; @@ -37,7 +35,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen /** * @author Spencer Gibb */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class HttpStatusInResponseHeadersFilterTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/NonStandardHeadersInResponseTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/NonStandardHeadersInResponseTests.java index a9197483..42cdb6cc 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/NonStandardHeadersInResponseTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/headers/NonStandardHeadersInResponseTests.java @@ -20,8 +20,7 @@ import java.net.URI; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Value; @@ -37,14 +36,12 @@ import org.springframework.context.annotation.Import; import org.springframework.core.annotation.Order; import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.client.WebClient; import org.springframework.web.util.UriComponentsBuilder; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = DEFINED_PORT, properties = { "server.port=62175" }) @DirtiesContext public class NonStandardHeadersInResponseTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingEmptyPredicatesTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingEmptyPredicatesTests.java index 297dfcc5..b3337410 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingEmptyPredicatesTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingEmptyPredicatesTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.handler; import java.net.URI; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Flux; import org.springframework.boot.SpringBootConfiguration; @@ -31,11 +30,9 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = {}) @DirtiesContext public class RoutePredicateHandlerMappingEmptyPredicatesTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingIntegrationTests.java index eef41bd3..ea3e3338 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingIntegrationTests.java @@ -16,10 +16,9 @@ package org.springframework.cloud.gateway.handler; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -31,7 +30,6 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.SocketUtils; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestParam; @@ -39,20 +37,19 @@ import org.springframework.web.bind.annotation.RestController; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT, properties = "management.server.port=${test.port}") @DirtiesContext public class RoutePredicateHandlerMappingIntegrationTests extends BaseWebClientTests { private static int managementPort; - @BeforeClass + @BeforeAll public static void beforeClass() { managementPort = SocketUtils.findAvailableTcpPort(); System.setProperty("test.port", String.valueOf(managementPort)); } - @AfterClass + @AfterAll public static void afterClass() { System.clearProperty("test.port"); } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingSameManagementPortIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingSameManagementPortIntegrationTests.java index 6b51b612..c539666a 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingSameManagementPortIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/RoutePredicateHandlerMappingSameManagementPortIntegrationTests.java @@ -16,10 +16,9 @@ package org.springframework.cloud.gateway.handler; -import org.junit.AfterClass; -import org.junit.BeforeClass; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -27,26 +26,24 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.SocketUtils; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = DEFINED_PORT) @DirtiesContext public class RoutePredicateHandlerMappingSameManagementPortIntegrationTests extends BaseWebClientTests { private static int samePort; - @BeforeClass + @BeforeAll public static void beforeClass() { samePort = SocketUtils.findAvailableTcpPort(); System.setProperty("server.port", String.valueOf(samePort)); System.setProperty("management.server.port", String.valueOf(samePort)); } - @AfterClass + @AfterAll public static void afterClass() { System.clearProperty("server.port"); System.clearProperty("management.server.port"); diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/BetweenRoutePredicateFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/BetweenRoutePredicateFactoryIntegrationTests.java index bb35cbc9..f312f65d 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/BetweenRoutePredicateFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/BetweenRoutePredicateFactoryIntegrationTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.time.ZonedDateTime; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -33,11 +32,9 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class BetweenRoutePredicateFactoryIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CloudFoundryRouteServiceRoutePredicateFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CloudFoundryRouteServiceRoutePredicateFactoryIntegrationTests.java index ca6968b3..a19c1d43 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CloudFoundryRouteServiceRoutePredicateFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CloudFoundryRouteServiceRoutePredicateFactoryIntegrationTests.java @@ -17,8 +17,7 @@ package org.springframework.cloud.gateway.handler.predicate; import com.fasterxml.jackson.databind.JsonNode; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -30,7 +29,6 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; @@ -38,7 +36,6 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen /** * @author Toshiaki Maki */ -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class CloudFoundryRouteServiceRoutePredicateFactoryIntegrationTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryIntegrationTests.java index 14666011..36ff2fa1 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryIntegrationTests.java @@ -16,8 +16,7 @@ package org.springframework.cloud.gateway.handler.predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -25,19 +24,17 @@ import org.springframework.boot.test.context.SpringBootTest; import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.CookieValue; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) -public class CookieRoutePredicateFactoryIntegrationTests extends BaseWebClientTests { +class CookieRoutePredicateFactoryIntegrationTests extends BaseWebClientTests { @Test - public void cookieRegexWorks() { + void cookieRegexWorks() { assertCookieValue("helloaaaaa"); assertCookieValue("hello"); @@ -53,10 +50,10 @@ public class CookieRoutePredicateFactoryIntegrationTests extends BaseWebClientTe @SpringBootConfiguration @Import(DefaultTestConfig.class) @RestController - public static class TestConfig { + static class TestConfig { @GetMapping("/httpbin/cookie") - public String cookie(@CookieValue("mycookie") String mycookie) { + String cookie(@CookieValue("mycookie") String mycookie) { return mycookie; } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryTests.java index a959f0ca..94e80fd7 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/CookieRoutePredicateFactoryTests.java @@ -18,7 +18,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.function.Predicate; -import org.junit.Test; +import org.junit.jupiter.api.Test; import org.springframework.cloud.gateway.handler.predicate.CookieRoutePredicateFactory.Config; import org.springframework.cloud.gateway.test.BaseWebClientTests; diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HeaderRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HeaderRoutePredicateFactoryTests.java index 2c134a30..525db877 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HeaderRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HeaderRoutePredicateFactoryTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.function.Predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -33,12 +32,10 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class HeaderRoutePredicateFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HostRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HostRoutePredicateFactoryTests.java index 35b9cd8a..10fb4f85 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HostRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/HostRoutePredicateFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.Arrays; import java.util.function.Predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -34,12 +33,10 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class HostRoutePredicateFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/MethodRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/MethodRoutePredicateFactoryTests.java index 074db693..4f195c8a 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/MethodRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/MethodRoutePredicateFactoryTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.function.Predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -35,12 +34,10 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class MethodRoutePredicateFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java index 32253ea3..3f4fff11 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/PathRoutePredicateFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.Arrays; import java.util.function.Predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; @@ -35,13 +34,11 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.server.ServerWebExchange; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class PathRoutePredicateFactoryTests extends BaseWebClientTests { diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactoryTests.java index 84255516..48892642 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/QueryRoutePredicateFactoryTests.java @@ -18,15 +18,15 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.function.Predicate; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; -import org.springframework.boot.test.system.OutputCaptureRule; +import org.springframework.boot.test.system.CapturedOutput; +import org.springframework.boot.test.system.OutputCaptureExtension; import org.springframework.cloud.gateway.handler.predicate.QueryRoutePredicateFactory.Config; import org.springframework.cloud.gateway.route.RouteLocator; import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; @@ -34,26 +34,20 @@ import org.springframework.cloud.gateway.test.BaseWebClientTests; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.hamcrest.Matchers.not; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext +@ExtendWith(OutputCaptureExtension.class) public class QueryRoutePredicateFactoryTests extends BaseWebClientTests { - @Rule - public OutputCaptureRule output = new OutputCaptureRule(); - @Test - public void noQueryParamWorks() { + public void noQueryParamWorks(CapturedOutput output) { testClient.get().uri("/get").exchange().expectStatus().isOk().expectHeader().valueEquals(ROUTE_ID_HEADER, "default_path_to_httpbin"); - output.expect(not(containsString("Error applying predicate for route: foo_query_param"))); + assertThat(output).doesNotContain("Error applying predicate for route: foo_query_param"); } @Test @@ -63,10 +57,10 @@ public class QueryRoutePredicateFactoryTests extends BaseWebClientTests { } @Test - public void emptyQueryParamWorks() { + public void emptyQueryParamWorks(CapturedOutput output) { testClient.get().uri("/get?foo").exchange().expectStatus().isOk().expectHeader().valueEquals(ROUTE_ID_HEADER, "default_path_to_httpbin"); - output.expect(not(containsString("Error applying predicate for route: foo_query_param"))); + assertThat(output).doesNotContain("Error applying predicate for route: foo_query_param"); } @Test diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/RemoteAddrRoutePredicateFactoryTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/RemoteAddrRoutePredicateFactoryTests.java index 184b65e7..aacb7ebe 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/RemoteAddrRoutePredicateFactoryTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/handler/predicate/RemoteAddrRoutePredicateFactoryTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.handler.predicate; import java.time.Duration; import java.util.function.Predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -38,14 +37,12 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.reactive.function.client.ClientResponse; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.cloud.gateway.test.TestUtils.assertStatus; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles({ "remote-address" }) 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 d7e5d2ec..8ad1397d 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 @@ -19,8 +19,8 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.Random; import java.util.function.Predicate; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnJre; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -36,16 +36,16 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; 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; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext +@DisabledOnJre(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 9bb136e3..3c098ca9 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 @@ -18,8 +18,8 @@ package org.springframework.cloud.gateway.handler.predicate; import java.util.Random; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.DisabledOnJre; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.SpringBootConfiguration; @@ -31,17 +31,17 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpHeaders; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; +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; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @ActiveProfiles("weights-404") @DirtiesContext -public class WeightRoutePredicateFactoryYaml404Tests extends BaseWebClientTests { +@DisabledOnJre(JAVA_17) +class WeightRoutePredicateFactoryYaml404Tests extends BaseWebClientTests { @Autowired private WeightCalculatorWebFilter filter; @@ -53,7 +53,7 @@ public class WeightRoutePredicateFactoryYaml404Tests extends BaseWebClientTests } @Test - public void weightsFromYamlNot404() { + void weightsFromYamlNot404() { filter.setRandom(getRandom(0.5)); testClient.get().uri("/get").header(HttpHeaders.HOST, "www.weight4041.org").exchange().expectStatus().isOk() @@ -63,9 +63,9 @@ public class WeightRoutePredicateFactoryYaml404Tests extends BaseWebClientTests @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { - public TestConfig(WeightCalculatorWebFilter filter) { + TestConfig(WeightCalculatorWebFilter filter) { Random random = getRandom(0.4); filter.setRandom(random); diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java index db8d27ba..f03dd48d 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/BaseWebClientTests.java @@ -20,7 +20,7 @@ import java.time.Duration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.junit.Before; +import org.junit.jupiter.api.BeforeEach; import reactor.core.publisher.Mono; import org.springframework.boot.SpringBootConfiguration; @@ -68,7 +68,7 @@ public class BaseWebClientTests { protected String baseUri; - @Before + @BeforeEach public void setup() throws Exception { setup(new ReactorClientHttpConnector(), "http://localhost:" + port); } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/CustomBlockHoundIntegration.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/CustomBlockHoundIntegration.java index 89ae2601..7c590933 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/CustomBlockHoundIntegration.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/CustomBlockHoundIntegration.java @@ -86,6 +86,11 @@ public class CustomBlockHoundIntegration implements BlockHoundIntegration { builder.allowBlockingCallsInside( "org.springframework.security.authentication.AbstractUserDetailsReactiveAuthenticationManager", "lambda$authenticate$4"); + + // Uses java.io.RandomAccessFile#readBytes + builder.allowBlockingCallsInside("org.springframework.context.annotation.ConfigurationClassParser", "parse"); + builder.allowBlockingCallsInside( + "org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader", "loadBeanDefinitions"); } } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/FormIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/FormIntegrationTests.java index 5fc08bc1..9a105d6d 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/FormIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/FormIntegrationTests.java @@ -19,8 +19,7 @@ package org.springframework.cloud.gateway.test; import java.nio.charset.StandardCharsets; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringBootConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -34,7 +33,6 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.http.client.MultipartBodyBuilder; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.LinkedMultiValueMap; import org.springframework.util.MultiValueMap; import org.springframework.web.reactive.function.BodyInserters; @@ -45,17 +43,16 @@ import static org.springframework.cloud.gateway.test.TestUtils.getMap; import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED; import static org.springframework.http.MediaType.MULTIPART_FORM_DATA; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @SuppressWarnings("unchecked") -public class FormIntegrationTests extends BaseWebClientTests { +class FormIntegrationTests extends BaseWebClientTests { public static final MediaType FORM_URL_ENCODED_CONTENT_TYPE = new MediaType(APPLICATION_FORM_URLENCODED, StandardCharsets.UTF_8); @Test - public void formUrlencodedWorks() { + void formUrlencodedWorks() { LinkedMultiValueMap formData = new LinkedMultiValueMap<>(); formData.add("foo", "bar"); formData.add("baz", "bam"); @@ -75,7 +72,7 @@ public class FormIntegrationTests extends BaseWebClientTests { } @Test - public void multipartFormDataWorksWebClient() { + void multipartFormDataWorksWebClient() { MultiValueMap> formData = createMultipartData(); // @formatter:off @@ -89,7 +86,7 @@ public class FormIntegrationTests extends BaseWebClientTests { } @Test - public void multipartFormDataWorksRestTemplate() { + void multipartFormDataWorksRestTemplate() { MultiValueMap> formData = createMultipartData(); TestRestTemplate rest = new TestRestTemplate(); @@ -116,7 +113,7 @@ public class FormIntegrationTests extends BaseWebClientTests { @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/GatewayIntegrationTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/GatewayIntegrationTests.java index b0074e78..5a5620be 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/GatewayIntegrationTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/GatewayIntegrationTests.java @@ -24,8 +24,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.hamcrest.BaseMatcher; import org.hamcrest.Description; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import org.springframework.beans.factory.annotation.Autowired; @@ -50,7 +49,6 @@ import org.springframework.http.HttpHeaders; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.server.ServerWebExchange; @@ -59,11 +57,10 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; import static org.springframework.cloud.gateway.test.TestUtils.getMap; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @SuppressWarnings("unchecked") -public class GatewayIntegrationTests extends BaseWebClientTests { +class GatewayIntegrationTests extends BaseWebClientTests { @Autowired private GatewayProperties properties; @@ -72,7 +69,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { private ApplicationContext context; @Test - public void listenersInOrder() { + void listenersInOrder() { assertThat(context).isInstanceOf(AbstractApplicationContext.class); AbstractApplicationContext ctxt = (AbstractApplicationContext) context; List> applicationListeners = new ArrayList<>(ctxt.getApplicationListeners()); @@ -84,7 +81,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { } @Test - public void complexContentTypeWorks() { + void complexContentTypeWorks() { testClient.post().uri("/headers").contentType(MediaType.APPLICATION_JSON).bodyValue("testdata") .header("Host", "www.complexcontenttype.org").exchange().expectStatus().isOk().expectBody(Map.class) .consumeWith(result -> { @@ -94,7 +91,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { } @Test - public void forwardedHeadersWork() { + void forwardedHeadersWork() { testClient.get().uri("/headers").exchange().expectStatus().isOk().expectBody(Map.class).consumeWith(result -> { Map headers = getMap(result.getResponseBody(), "headers"); assertThat(headers).containsKeys(ForwardedHeadersFilter.FORWARDED_HEADER, @@ -111,7 +108,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { } @Test - public void compositeRouteWorks() { + void compositeRouteWorks() { testClient.get().uri("/headers?foo=bar&baz").header("Host", "www.foo.org").header("X-Request-Id", "123") .cookie("chocolate", "chip").exchange().expectStatus().isOk().expectHeader() .valueEquals(HANDLER_MAPPER_HEADER, RoutePredicateHandlerMapping.class.getSimpleName()).expectHeader() @@ -120,7 +117,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { } @Test - public void defaultFiltersWorks() { + void defaultFiltersWorks() { assertThat(this.properties.getDefaultFilters()).isNotEmpty(); testClient.get().uri("/headers").header("Host", "www.addresponseheader.org").exchange().expectStatus().isOk() @@ -132,13 +129,13 @@ public class GatewayIntegrationTests extends BaseWebClientTests { } @Test - public void loadBalancerFilterWorks() { + void loadBalancerFilterWorks() { testClient.get().uri("/get").header("Host", "www.loadbalancerclient.org").exchange().expectStatus().isOk() .expectHeader().valueEquals(ROUTE_ID_HEADER, "load_balancer_client_test"); } @Test - public void loadBalancerFilterNoClientWorks() { + void loadBalancerFilterNoClientWorks() { testClient.get().uri("/get").header("Host", "www.loadbalancerclientempty.org").exchange().expectStatus() .value(new BaseMatcher() { @Override @@ -159,7 +156,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { @Test // gh-374 no content type/empty body causes NPR in NettyRoutingFilter - public void noContentType() { + void noContentType() { testClient.get().uri("/nocontenttype").exchange().expectStatus().is2xxSuccessful(); } @@ -167,7 +164,7 @@ public class GatewayIntegrationTests extends BaseWebClientTests { @SpringBootConfiguration @Import(DefaultTestConfig.class) @RestController - public static class TestConfig { + static class TestConfig { private static final Log log = LogFactory.getLog(TestConfig.class); @@ -178,13 +175,13 @@ public class GatewayIntegrationTests extends BaseWebClientTests { } @RequestMapping("/httpbin/nocontenttype") - public ResponseEntity nocontenttype() { + ResponseEntity nocontenttype() { return ResponseEntity.status(204).build(); } @Bean @Order(-1) - public GlobalFilter postFilter() { + GlobalFilter postFilter() { return (exchange, chain) -> { log.info("postFilter start"); return chain.filter(exchange).then(postFilterWork(exchange)); diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/HttpStatusTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/HttpStatusTests.java index 58d3ee11..11b0c574 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/HttpStatusTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/HttpStatusTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.test; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringBootConfiguration; @@ -30,14 +29,12 @@ import org.springframework.context.annotation.Import; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @SuppressWarnings("unchecked") @@ -48,13 +45,13 @@ public class HttpStatusTests extends BaseWebClientTests { } @Test - public void notFoundResponseWorks() { + void notFoundResponseWorks() { testClient.get().uri("/status/404").exchange().expectStatus().isEqualTo(HttpStatus.NOT_FOUND) .expectBody(String.class).isEqualTo("Failed with 404"); } @Test - public void nonStandardCodeWorks() { + void nonStandardCodeWorks() { ResponseEntity response = new TestRestTemplate().getForEntity(baseUri + "/status/432", String.class); assertThat(response.getStatusCodeValue()).isEqualTo(432); assertThat(response.getBody()).isEqualTo("Failed with 432"); @@ -66,13 +63,13 @@ public class HttpStatusTests extends BaseWebClientTests { } @Test - public void serverErrorResponseWorks() { + void serverErrorResponseWorks() { testClient.get().uri("/status/500").exchange().expectStatus().isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR) .expectBody(String.class).isEqualTo("Failed with 500"); } @Test - public void normalErrorPageWorks() { + void normalErrorPageWorks() { testClient.get().uri("/exception").exchange().expectStatus().isEqualTo(HttpStatus.INTERNAL_SERVER_ERROR) .expectBody(Map.class) .consumeWith(result -> assertThat(result.getResponseBody()).hasSizeGreaterThanOrEqualTo(5) @@ -83,10 +80,10 @@ public class HttpStatusTests extends BaseWebClientTests { @SpringBootConfiguration @RestController @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { @RequestMapping("/httpbin/exception") - public String exception() { + String exception() { throw new RuntimeException("an error"); } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/PostTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/PostTests.java index 71d1a865..acc260a6 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/PostTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/PostTests.java @@ -18,8 +18,7 @@ package org.springframework.cloud.gateway.test; import java.util.Map; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -28,20 +27,18 @@ import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.context.annotation.Import; import org.springframework.test.annotation.DirtiesContext; -import org.springframework.test.context.junit4.SpringRunner; import static org.assertj.core.api.Assertions.assertThat; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @SuppressWarnings("unchecked") // TODO: why does this have to be in a separate test? -public class PostTests extends BaseWebClientTests { +class PostTests extends BaseWebClientTests { @Test - public void postWorks() { + void postWorks() { Mono result = webClient.post().uri("/post").header("Host", "www.example.org").bodyValue("testdata") .retrieve().bodyToMono(Map.class); @@ -52,7 +49,7 @@ public class PostTests extends BaseWebClientTests { @EnableAutoConfiguration @SpringBootConfiguration @Import(DefaultTestConfig.class) - public static class TestConfig { + static class TestConfig { } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/ClientCertAuthSSLTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/ClientCertAuthSSLTests.java index a2210e49..047215c3 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/ClientCertAuthSSLTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/ClientCertAuthSSLTests.java @@ -25,9 +25,8 @@ import javax.net.ssl.SSLException; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import reactor.netty.http.client.HttpClient; import org.springframework.beans.factory.annotation.Value; @@ -36,12 +35,10 @@ import org.springframework.boot.web.server.WebServerException; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.util.ResourceUtils; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles("client-auth-ssl") @@ -56,7 +53,7 @@ public class ClientCertAuthSSLTests extends SingleCertSSLTests { @Value("${spring.cloud.gateway.httpclient.ssl.key-password}") private String keyPassword; - @Before + @BeforeEach public void setup() throws Exception { KeyStore store = KeyStore.getInstance("JKS"); diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/MultiCertSSLTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/MultiCertSSLTests.java index eff86f34..248c67a7 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/MultiCertSSLTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/MultiCertSSLTests.java @@ -16,16 +16,12 @@ package org.springframework.cloud.gateway.test.ssl; -import org.junit.runner.RunWith; - import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles("multi-cert-ssl") diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SSLHandshakeTimeoutTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SSLHandshakeTimeoutTests.java index 1947019b..a0f5a479 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SSLHandshakeTimeoutTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SSLHandshakeTimeoutTests.java @@ -16,19 +16,16 @@ package org.springframework.cloud.gateway.test.ssl; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.web.reactive.server.JsonPathAssertions; import org.springframework.test.web.reactive.server.WebTestClient.ResponseSpec; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) // this test works because it assumes TLS hand shake cannot be done in 1ms. It takes // closer to 80ms @SpringBootTest(webEnvironment = RANDOM_PORT, diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SingleCertSSLTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SingleCertSSLTests.java index be50ada9..cfc7d11c 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SingleCertSSLTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/test/ssl/SingleCertSSLTests.java @@ -21,9 +21,8 @@ import javax.net.ssl.SSLException; import io.netty.handler.ssl.SslContext; import io.netty.handler.ssl.SslContextBuilder; import io.netty.handler.ssl.util.InsecureTrustManagerFactory; -import org.junit.Before; -import org.junit.Test; -import org.junit.runner.RunWith; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import reactor.netty.http.client.HttpClient; import org.springframework.boot.SpringBootConfiguration; @@ -35,19 +34,17 @@ import org.springframework.http.ResponseEntity; import org.springframework.http.client.reactive.ReactorClientHttpConnector; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ActiveProfiles; -import org.springframework.test.context.junit4.SpringRunner; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.RANDOM_PORT; -@RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext @ActiveProfiles("single-cert-ssl") public class SingleCertSSLTests extends BaseWebClientTests { - @Before + @BeforeEach public void setup() throws Exception { try { SslContext sslContext = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE) From c8a13324658dcdb7924481322b3d8a9ee5a155f1 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 21 Sep 2021 15:06:36 +0000 Subject: [PATCH 2/8] Update SNAPSHOT to 3.0.4 --- docs/pom.xml | 2 +- pom.xml | 8 ++++---- spring-cloud-gateway-dependencies/pom.xml | 4 ++-- .../mvc-failure-analyzer/pom.xml | 2 +- spring-cloud-gateway-integration-tests/pom.xml | 2 +- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-server/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 24b65377..1aac0feb 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 spring-cloud-gateway-docs jar diff --git a/pom.xml b/pom.xml index 77366abc..07662827 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 pom Spring Cloud Gateway @@ -15,7 +15,7 @@ org.springframework.cloud spring-cloud-build - 3.0.4-SNAPSHOT + 3.0.4 @@ -54,8 +54,8 @@ 1.0.6.RELEASE 1.8 1.0.0 - 2.0.3-SNAPSHOT - 3.0.4-SNAPSHOT + 2.0.2 + 3.0.4 1.15.1 diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index da8b9b0e..38d2ec8d 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4-SNAPSHOT + 3.0.4 spring-cloud-gateway-dependencies - 3.0.4-SNAPSHOT + 3.0.4 pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml index 930c0616..941639e7 100644 --- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml +++ b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway-integration-tests - 3.0.4-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-integration-tests/pom.xml b/spring-cloud-gateway-integration-tests/pom.xml index da056569..ad51bfbb 100644 --- a/spring-cloud-gateway-integration-tests/pom.xml +++ b/spring-cloud-gateway-integration-tests/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index 64667874..1cbaa920 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index c8e42788..ca3e6867 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-server/pom.xml b/spring-cloud-gateway-server/pom.xml index 4299707c..7e3ad944 100644 --- a/spring-cloud-gateway-server/pom.xml +++ b/spring-cloud-gateway-server/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 .. spring-cloud-gateway-server diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index 81037e70..02845e20 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index 808e7eda..4067e2a1 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.4 .. spring-cloud-starter-gateway From 505fe64206e91e9bbf2af4b1a1939e00ec748233 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 21 Sep 2021 15:08:41 +0000 Subject: [PATCH 3/8] Going back to snapshots --- docs/pom.xml | 2 +- pom.xml | 8 ++++---- spring-cloud-gateway-dependencies/pom.xml | 4 ++-- .../mvc-failure-analyzer/pom.xml | 2 +- spring-cloud-gateway-integration-tests/pom.xml | 2 +- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-server/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 1aac0feb..24b65377 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT spring-cloud-gateway-docs jar diff --git a/pom.xml b/pom.xml index 07662827..77366abc 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT pom Spring Cloud Gateway @@ -15,7 +15,7 @@ org.springframework.cloud spring-cloud-build - 3.0.4 + 3.0.4-SNAPSHOT @@ -54,8 +54,8 @@ 1.0.6.RELEASE 1.8 1.0.0 - 2.0.2 - 3.0.4 + 2.0.3-SNAPSHOT + 3.0.4-SNAPSHOT 1.15.1 diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index 38d2ec8d..da8b9b0e 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4 + 3.0.4-SNAPSHOT spring-cloud-gateway-dependencies - 3.0.4 + 3.0.4-SNAPSHOT pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml index 941639e7..930c0616 100644 --- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml +++ b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway-integration-tests - 3.0.4 + 3.0.4-SNAPSHOT .. diff --git a/spring-cloud-gateway-integration-tests/pom.xml b/spring-cloud-gateway-integration-tests/pom.xml index ad51bfbb..da056569 100644 --- a/spring-cloud-gateway-integration-tests/pom.xml +++ b/spring-cloud-gateway-integration-tests/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT .. diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index 1cbaa920..64667874 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index ca3e6867..c8e42788 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT .. diff --git a/spring-cloud-gateway-server/pom.xml b/spring-cloud-gateway-server/pom.xml index 7e3ad944..4299707c 100644 --- a/spring-cloud-gateway-server/pom.xml +++ b/spring-cloud-gateway-server/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT .. spring-cloud-gateway-server diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index 02845e20..81037e70 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index 4067e2a1..808e7eda 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.4-SNAPSHOT .. spring-cloud-starter-gateway From 6a98b73bfb0e0d967abe5b344b902886f524eaaf Mon Sep 17 00:00:00 2001 From: buildmaster Date: Tue, 21 Sep 2021 15:08:41 +0000 Subject: [PATCH 4/8] Bumping versions to 3.0.5-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-gateway-dependencies/pom.xml | 4 ++-- .../mvc-failure-analyzer/pom.xml | 2 +- spring-cloud-gateway-integration-tests/pom.xml | 2 +- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-server/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 24b65377..694fafc4 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT spring-cloud-gateway-docs jar diff --git a/pom.xml b/pom.xml index 77366abc..187fa21a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT pom Spring Cloud Gateway @@ -15,7 +15,7 @@ org.springframework.cloud spring-cloud-build - 3.0.4-SNAPSHOT + 3.0.4 @@ -55,7 +55,7 @@ 1.8 1.0.0 2.0.3-SNAPSHOT - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT 1.15.1 diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index da8b9b0e..2b96e0f6 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT spring-cloud-gateway-dependencies - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml index 930c0616..299ba1be 100644 --- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml +++ b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway-integration-tests - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-integration-tests/pom.xml b/spring-cloud-gateway-integration-tests/pom.xml index da056569..2a8e8729 100644 --- a/spring-cloud-gateway-integration-tests/pom.xml +++ b/spring-cloud-gateway-integration-tests/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index 64667874..36f353fc 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index c8e42788..459f12a3 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-server/pom.xml b/spring-cloud-gateway-server/pom.xml index 4299707c..bc100403 100644 --- a/spring-cloud-gateway-server/pom.xml +++ b/spring-cloud-gateway-server/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. spring-cloud-gateway-server diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index 81037e70..61e6cffb 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index 808e7eda..ec7ed2e1 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4-SNAPSHOT + 3.0.5-SNAPSHOT .. spring-cloud-starter-gateway From 297844416888b361be4c26b9880e7e79b4894883 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 22 Sep 2021 09:06:55 +0000 Subject: [PATCH 5/8] Update SNAPSHOT to 3.0.4 --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-gateway-dependencies/pom.xml | 4 ++-- .../mvc-failure-analyzer/pom.xml | 2 +- spring-cloud-gateway-integration-tests/pom.xml | 2 +- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-server/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 694fafc4..1aac0feb 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 spring-cloud-gateway-docs jar diff --git a/pom.xml b/pom.xml index 187fa21a..07662827 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 pom Spring Cloud Gateway @@ -54,8 +54,8 @@ 1.0.6.RELEASE 1.8 1.0.0 - 2.0.3-SNAPSHOT - 3.0.5-SNAPSHOT + 2.0.2 + 3.0.4 1.15.1 diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index 2b96e0f6..38d2ec8d 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.5-SNAPSHOT + 3.0.4 spring-cloud-gateway-dependencies - 3.0.5-SNAPSHOT + 3.0.4 pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml index 299ba1be..941639e7 100644 --- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml +++ b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway-integration-tests - 3.0.5-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-integration-tests/pom.xml b/spring-cloud-gateway-integration-tests/pom.xml index 2a8e8729..ad51bfbb 100644 --- a/spring-cloud-gateway-integration-tests/pom.xml +++ b/spring-cloud-gateway-integration-tests/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index 36f353fc..1cbaa920 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index 459f12a3..ca3e6867 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-gateway-server/pom.xml b/spring-cloud-gateway-server/pom.xml index bc100403..7e3ad944 100644 --- a/spring-cloud-gateway-server/pom.xml +++ b/spring-cloud-gateway-server/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 .. spring-cloud-gateway-server diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index 61e6cffb..02845e20 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index ec7ed2e1..4067e2a1 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.5-SNAPSHOT + 3.0.4 .. spring-cloud-starter-gateway From 3948aad945ac67ed176841c21866271cab847037 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 22 Sep 2021 09:08:40 +0000 Subject: [PATCH 6/8] Going back to snapshots --- docs/pom.xml | 2 +- pom.xml | 6 +++--- spring-cloud-gateway-dependencies/pom.xml | 4 ++-- .../mvc-failure-analyzer/pom.xml | 2 +- spring-cloud-gateway-integration-tests/pom.xml | 2 +- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-server/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index 1aac0feb..694fafc4 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT spring-cloud-gateway-docs jar diff --git a/pom.xml b/pom.xml index 07662827..187fa21a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT pom Spring Cloud Gateway @@ -54,8 +54,8 @@ 1.0.6.RELEASE 1.8 1.0.0 - 2.0.2 - 3.0.4 + 2.0.3-SNAPSHOT + 3.0.5-SNAPSHOT 1.15.1 diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index 38d2ec8d..2b96e0f6 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 3.0.4 + 3.0.5-SNAPSHOT spring-cloud-gateway-dependencies - 3.0.4 + 3.0.5-SNAPSHOT pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml index 941639e7..299ba1be 100644 --- a/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml +++ b/spring-cloud-gateway-integration-tests/mvc-failure-analyzer/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway-integration-tests - 3.0.4 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-integration-tests/pom.xml b/spring-cloud-gateway-integration-tests/pom.xml index ad51bfbb..2a8e8729 100644 --- a/spring-cloud-gateway-integration-tests/pom.xml +++ b/spring-cloud-gateway-integration-tests/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index 1cbaa920..36f353fc 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index ca3e6867..459f12a3 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-gateway-server/pom.xml b/spring-cloud-gateway-server/pom.xml index 7e3ad944..bc100403 100644 --- a/spring-cloud-gateway-server/pom.xml +++ b/spring-cloud-gateway-server/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT .. spring-cloud-gateway-server diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index 02845e20..61e6cffb 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index 4067e2a1..ec7ed2e1 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 3.0.4 + 3.0.5-SNAPSHOT .. spring-cloud-starter-gateway From fc8b824baafe22c0ec4a18e8fe757e53d8164514 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Wed, 22 Sep 2021 09:08:40 +0000 Subject: [PATCH 7/8] Bumping versions to 3.0.5-SNAPSHOT after release --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 187fa21a..c0c70828 100644 --- a/pom.xml +++ b/pom.xml @@ -54,8 +54,8 @@ 1.0.6.RELEASE 1.8 1.0.0 - 2.0.3-SNAPSHOT - 3.0.5-SNAPSHOT + 2.0.2 + 3.0.4 1.15.1 From ac89ef4f4c96743338c70768d55a1936d43070a8 Mon Sep 17 00:00:00 2001 From: spencergibb Date: Wed, 6 Oct 2021 19:38:28 -0400 Subject: [PATCH 8/8] Updates metrics prefix Fixes gh-2273 --- docs/src/main/asciidoc/spring-cloud-gateway.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/src/main/asciidoc/spring-cloud-gateway.adoc index 4f227772..31a4a358 100644 --- a/docs/src/main/asciidoc/spring-cloud-gateway.adoc +++ b/docs/src/main/asciidoc/spring-cloud-gateway.adoc @@ -1856,7 +1856,7 @@ spring: === The Gateway Metrics Filter -To enable gateway metrics, add spring-boot-starter-actuator as a project dependency. Then, by default, the gateway metrics filter runs as long as the property `spring.cloud.gateway.metrics.enabled` is not set to `false`. This filter adds a timer metric named `gateway.requests` with the following tags: +To enable gateway metrics, add spring-boot-starter-actuator as a project dependency. Then, by default, the gateway metrics filter runs as long as the property `spring.cloud.gateway.metrics.enabled` is not set to `false`. This filter adds a timer metric named `spring.cloud.gateway.requests` with the following tags: * `routeId`: The route ID. * `routeUri`: The URI to which the API is routed. @@ -1865,7 +1865,7 @@ To enable gateway metrics, add spring-boot-starter-actuator as a project depende * `httpStatusCode`: The HTTP Status of the request returned to the client. * `httpMethod`: The HTTP method used for the request. -These metrics are then available to be scraped from `/actuator/metrics/gateway.requests` and can be easily integrated with Prometheus to create a link:images/gateway-grafana-dashboard.jpeg[Grafana] link:gateway-grafana-dashboard.json[dashboard]. +These metrics are then available to be scraped from `/actuator/metrics/spring.cloud.gateway.requests` and can be easily integrated with Prometheus to create a link:images/gateway-grafana-dashboard.jpeg[Grafana] link:gateway-grafana-dashboard.json[dashboard]. NOTE: To enable the prometheus endpoint, add `micrometer-registry-prometheus` as a project dependency.