Fix StepVerifier usage in HealthIndicatorReactiveAdapterTests

This commit is contained in:
dreis2211 2019-11-21 17:36:33 +01:00 committed by Brian Clozel
parent 24906e6f08
commit 21dc7e9ca3
1 changed files with 3 additions and 1 deletions

View File

@ -16,6 +16,8 @@
package org.springframework.boot.actuate.health;
import java.time.Duration;
import org.junit.jupiter.api.Test;
import reactor.test.StepVerifier;
@ -44,7 +46,7 @@ class HealthIndicatorReactiveAdapterTests {
HealthIndicator delegate = mock(HealthIndicator.class);
HealthIndicatorReactiveAdapter adapter = new HealthIndicatorReactiveAdapter(delegate);
given(delegate.health()).willThrow(new IllegalStateException("Expected"));
StepVerifier.create(adapter.health()).expectError(IllegalStateException.class);
StepVerifier.create(adapter.health()).expectError(IllegalStateException.class).verify(Duration.ofSeconds(10));
}
@Test