From dfa048faad9851e77265448b44f3732f31d6d0ef Mon Sep 17 00:00:00 2001 From: spencergibb Date: Fri, 9 Oct 2020 16:13:40 -0400 Subject: [PATCH] Updates tests to use default metrics prefix. --- .../gateway/filter/GatewayMetricsFilterCustomTagsTests.java | 3 ++- .../cloud/gateway/filter/GatewayMetricsFilterTests.java | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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 a775083a..eaee8576 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 @@ -37,6 +37,7 @@ 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.config.GatewayProperties.Metrics.DEFAULT_PREFIX; /** * @author Ingyu Hwang @@ -46,7 +47,7 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen @DirtiesContext public class GatewayMetricsFilterCustomTagsTests extends BaseWebClientTests { - private static final String REQUEST_METRICS_NAME = "gateway.requests"; + private static final String REQUEST_METRICS_NAME = DEFAULT_PREFIX + ".requests"; @Autowired private MeterRegistry meterRegistry; 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 b99097d4..d76a2da6 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 @@ -43,13 +43,14 @@ 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; +import static org.springframework.cloud.gateway.config.GatewayProperties.Metrics.DEFAULT_PREFIX; @RunWith(SpringRunner.class) @SpringBootTest(webEnvironment = RANDOM_PORT) @DirtiesContext public class GatewayMetricsFilterTests extends BaseWebClientTests { - private static final String REQUEST_METRICS_NAME = "gateway.requests"; + private static final String REQUEST_METRICS_NAME = DEFAULT_PREFIX + ".requests"; @Autowired private MeterRegistry meterRegistry;