Skip to content

Commit 43fa69d

Browse files
author
Robert Winkler
committed
Issue ReactiveX#212: Added test to FluxCircuitBreakerTest to verify that an error is propagated when you subscribe to Flux.error, but the error is not thrown onSubscribe.
1 parent 81d6208 commit 43fa69d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

resilience4j-reactor/src/test/java/io/github/resilience4j/reactor/circuitbreaker/operator/FluxCircuitBreakerTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public void shouldPropagateError() {
4848
assertSingleFailedCall();
4949
}
5050

51+
@Test
52+
public void shouldPropagateErrorWhenErrorNotOnSubscribe() {
53+
StepVerifier.create(
54+
Flux.error(new IOException("BAM!"), true)
55+
.transform(CircuitBreakerOperator.of(circuitBreaker)))
56+
.expectError(IOException.class)
57+
.verify(Duration.ofSeconds(1));
58+
59+
assertSingleFailedCall();
60+
}
61+
5162
@Test
5263
public void shouldEmitErrorWithCircuitBreakerOpenException() {
5364
circuitBreaker.transitionToOpenState();

0 commit comments

Comments
 (0)