From 85107d7acf062e56d74c9b65fcc3288e95f01f85 Mon Sep 17 00:00:00 2001 From: Diego Berrueta Date: Thu, 13 Dec 2018 23:53:27 +1100 Subject: [PATCH] Change endpoint names to ensure compatibility with future SB releases (#300) * #286: Change endpoint names to ensure compatibility with future SB releases Since Spring Boot 2.1.x, the applications emit a warning on startup if the endpoint name contains a dash or a dot. Future versions of Spring Boot may ban these symbols completely. * Update tests to reflect new endpoint URL --- .../monitoring/endpoint/CircuitBreakerEventsEndpoint.java | 2 +- .../monitoring/endpoint/RateLimiterEventsEndpoint.java | 2 +- .../circuitbreaker/CircuitBreakerAutoConfigurationTest.java | 4 ++-- .../ratelimiter/RateLimiterAutoConfigurationTest.java | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/circuitbreaker/monitoring/endpoint/CircuitBreakerEventsEndpoint.java b/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/circuitbreaker/monitoring/endpoint/CircuitBreakerEventsEndpoint.java index ef574a9173..c4186234a8 100644 --- a/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/circuitbreaker/monitoring/endpoint/CircuitBreakerEventsEndpoint.java +++ b/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/circuitbreaker/monitoring/endpoint/CircuitBreakerEventsEndpoint.java @@ -27,7 +27,7 @@ import io.github.resilience4j.consumer.EventConsumerRegistry; -@Endpoint(id = "circuitbreaker-events") +@Endpoint(id = "circuitbreakerevents") public class CircuitBreakerEventsEndpoint { private final EventConsumerRegistry eventConsumerRegistry; diff --git a/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/ratelimiter/monitoring/endpoint/RateLimiterEventsEndpoint.java b/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/ratelimiter/monitoring/endpoint/RateLimiterEventsEndpoint.java index f23a30605d..ef8c7b8dca 100644 --- a/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/ratelimiter/monitoring/endpoint/RateLimiterEventsEndpoint.java +++ b/resilience4j-spring-boot2/src/main/java/io/github/resilience4j/ratelimiter/monitoring/endpoint/RateLimiterEventsEndpoint.java @@ -28,7 +28,7 @@ import io.github.resilience4j.ratelimiter.monitoring.model.RateLimiterEventDTO; import io.github.resilience4j.ratelimiter.monitoring.model.RateLimiterEventsEndpointResponse; -@Endpoint(id = "ratelimiter-events") +@Endpoint(id = "ratelimiterevents") public class RateLimiterEventsEndpoint { private final EventConsumerRegistry eventsConsumerRegistry; diff --git a/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/circuitbreaker/CircuitBreakerAutoConfigurationTest.java b/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/circuitbreaker/CircuitBreakerAutoConfigurationTest.java index 178f66bba9..d205884b0b 100644 --- a/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/circuitbreaker/CircuitBreakerAutoConfigurationTest.java +++ b/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/circuitbreaker/CircuitBreakerAutoConfigurationTest.java @@ -90,10 +90,10 @@ public void testCircuitBreakerAutoConfiguration() throws IOException { assertThat(circuitBreakerList.getBody().getCircuitBreakers()).hasSize(2).containsExactly("backendA", "backendB"); // expect circuitbreaker-event actuator endpoint recorded both events - ResponseEntity circuitBreakerEventList = restTemplate.getForEntity("/actuator/circuitbreaker-events", CircuitBreakerEventsEndpointResponse.class); + ResponseEntity circuitBreakerEventList = restTemplate.getForEntity("/actuator/circuitbreakerevents", CircuitBreakerEventsEndpointResponse.class); assertThat(circuitBreakerEventList.getBody().getCircuitBreakerEvents()).hasSize(2); - circuitBreakerEventList = restTemplate.getForEntity("/actuator/circuitbreaker-events?name=backendA", CircuitBreakerEventsEndpointResponse.class); + circuitBreakerEventList = restTemplate.getForEntity("/actuator/circuitbreakerevents?name=backendA", CircuitBreakerEventsEndpointResponse.class); assertThat(circuitBreakerEventList.getBody().getCircuitBreakerEvents()).hasSize(2); // expect no health indicator for backendB, as it is disabled via properties diff --git a/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/ratelimiter/RateLimiterAutoConfigurationTest.java b/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/ratelimiter/RateLimiterAutoConfigurationTest.java index 0e9eae729b..4731831b2c 100644 --- a/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/ratelimiter/RateLimiterAutoConfigurationTest.java +++ b/resilience4j-spring-boot2/src/test/java/io/github/resilience4j/ratelimiter/RateLimiterAutoConfigurationTest.java @@ -105,7 +105,7 @@ public void testRateLimiterAutoConfiguration() throws IOException { } ResponseEntity rateLimiterEventList = restTemplate - .getForEntity("/actuator/ratelimiter-events", RateLimiterEventsEndpointResponse.class); + .getForEntity("/actuator/ratelimiterevents", RateLimiterEventsEndpointResponse.class); List eventsList = rateLimiterEventList.getBody().getEventsList(); assertThat(eventsList).isNotEmpty();