Merge branch 'fix-timer-metric-name' of https://github.com/abelsromero/spring-cloud-gateway into abelsromero-fix-timer-metric-name
This commit is contained in:
@@ -44,7 +44,7 @@ import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
@Import(AdditionalRoutesImportSelector.class)
|
||||
public class GatewaySampleApplication {
|
||||
|
||||
public static final String HELLO_FROM_FAKE_ACTUATOR_METRICS_GATEWAY_REQUESTS = "hello from fake /actuator/metrics/gateway.requests";
|
||||
public static final String HELLO_FROM_FAKE_ACTUATOR_METRICS_GATEWAY_REQUESTS = "hello from fake /actuator/metrics/spring.cloud.gateway.requests";
|
||||
|
||||
@Value("${test.uri:http://httpbin.org:80}")
|
||||
String uri;
|
||||
@@ -165,7 +165,7 @@ public class GatewaySampleApplication {
|
||||
@Bean
|
||||
public RouterFunction<ServerResponse> testWhenMetricPathIsNotMeet() {
|
||||
RouterFunction<ServerResponse> route = RouterFunctions
|
||||
.route(RequestPredicates.path("/actuator/metrics/gateway.requests"), request -> ServerResponse.ok()
|
||||
.route(RequestPredicates.path("/actuator/metrics/spring.cloud.gateway.requests"), request -> ServerResponse.ok()
|
||||
.body(BodyInserters.fromValue(HELLO_FROM_FAKE_ACTUATOR_METRICS_GATEWAY_REQUESTS)));
|
||||
return route;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public class GatewaySampleApplicationWithoutMetricsTests {
|
||||
public void actuatorMetrics() {
|
||||
init(TestConfig.class);
|
||||
webClient.get().uri("/get").exchange().expectStatus().isOk();
|
||||
webClient.get().uri("http://localhost:" + port + "/actuator/metrics/gateway.requests").exchange().expectStatus()
|
||||
webClient.get().uri("http://localhost:" + port + "/actuator/metrics/spring.cloud.gateway.requests").exchange().expectStatus()
|
||||
.isOk().expectBody(String.class)
|
||||
.isEqualTo(GatewaySampleApplication.HELLO_FROM_FAKE_ACTUATOR_METRICS_GATEWAY_REQUESTS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user