Skip to content

Commit

Permalink
Change endpoint names to ensure compatibility with future SB releases (
Browse files Browse the repository at this point in the history
…ReactiveX#300)

* ReactiveX#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
  • Loading branch information
berrueta authored and RobWin committed Dec 13, 2018
1 parent 8a0f656 commit 85107d7
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import io.github.resilience4j.consumer.EventConsumerRegistry;


@Endpoint(id = "circuitbreaker-events")
@Endpoint(id = "circuitbreakerevents")
public class CircuitBreakerEventsEndpoint {

private final EventConsumerRegistry<CircuitBreakerEvent> eventConsumerRegistry;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<RateLimiterEvent> eventsConsumerRegistry;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<CircuitBreakerEventsEndpointResponse> circuitBreakerEventList = restTemplate.getForEntity("/actuator/circuitbreaker-events", CircuitBreakerEventsEndpointResponse.class);
ResponseEntity<CircuitBreakerEventsEndpointResponse> 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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public void testRateLimiterAutoConfiguration() throws IOException {
}

ResponseEntity<RateLimiterEventsEndpointResponse> rateLimiterEventList = restTemplate
.getForEntity("/actuator/ratelimiter-events", RateLimiterEventsEndpointResponse.class);
.getForEntity("/actuator/ratelimiterevents", RateLimiterEventsEndpointResponse.class);

List<RateLimiterEventDTO> eventsList = rateLimiterEventList.getBody().getEventsList();
assertThat(eventsList).isNotEmpty();
Expand Down

0 comments on commit 85107d7

Please sign in to comment.