|
|
@ -72,9 +72,9 @@ class CompositeReactiveHealthIndicatorTests {
|
|
|
|
void timeoutReachedUsesFallback() {
|
|
|
|
void timeoutReachedUsesFallback() {
|
|
|
|
Map<String, ReactiveHealthIndicator> indicators = new HashMap<>();
|
|
|
|
Map<String, ReactiveHealthIndicator> indicators = new HashMap<>();
|
|
|
|
indicators.put("slow", new TimeoutHealth(10000, Status.UP));
|
|
|
|
indicators.put("slow", new TimeoutHealth(10000, Status.UP));
|
|
|
|
indicators.put("fast", new TimeoutHealth(10, Status.UP));
|
|
|
|
indicators.put("fast", new TimeoutHealth(250, Status.UP));
|
|
|
|
CompositeReactiveHealthIndicator indicator = new CompositeReactiveHealthIndicator(this.healthAggregator,
|
|
|
|
CompositeReactiveHealthIndicator indicator = new CompositeReactiveHealthIndicator(this.healthAggregator,
|
|
|
|
new DefaultReactiveHealthIndicatorRegistry(indicators)).timeoutStrategy(100, UNKNOWN_HEALTH);
|
|
|
|
new DefaultReactiveHealthIndicatorRegistry(indicators)).timeoutStrategy(1000, UNKNOWN_HEALTH);
|
|
|
|
StepVerifier.create(indicator.health()).consumeNextWith((h) -> {
|
|
|
|
StepVerifier.create(indicator.health()).consumeNextWith((h) -> {
|
|
|
|
assertThat(h.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(h.getStatus()).isEqualTo(Status.UP);
|
|
|
|
assertThat(h.getDetails()).containsOnlyKeys("slow", "fast");
|
|
|
|
assertThat(h.getDetails()).containsOnlyKeys("slow", "fast");
|
|
|
|