|
|
|
@ -74,8 +74,9 @@ public class ReactiveSentinelCircuitBreakerIntegrationTest {
|
|
|
|
|
// Then in the next 5s, the fallback method should be called.
|
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
|
StepVerifier.create(service.slow()).expectNext("fallback").verifyComplete();
|
|
|
|
|
Thread.sleep(1000);
|
|
|
|
|
Thread.sleep(900);
|
|
|
|
|
}
|
|
|
|
|
Thread.sleep(500);
|
|
|
|
|
|
|
|
|
|
// Half-open recovery (will re-open the circuit breaker).
|
|
|
|
|
StepVerifier.create(service.slow()).expectNext("slow").verifyComplete();
|
|
|
|
@ -91,8 +92,9 @@ public class ReactiveSentinelCircuitBreakerIntegrationTest {
|
|
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
|
|
StepVerifier.create(service.slowFlux()).expectNext("flux_fallback")
|
|
|
|
|
.verifyComplete();
|
|
|
|
|
Thread.sleep(1000);
|
|
|
|
|
Thread.sleep(900);
|
|
|
|
|
}
|
|
|
|
|
Thread.sleep(500);
|
|
|
|
|
|
|
|
|
|
// Half-open recovery (will re-open the circuit breaker).
|
|
|
|
|
StepVerifier.create(service.slowFlux()).expectNext("slowflux").verifyComplete();
|
|
|
|
|