Skip to content

Commit

Permalink
Issue #212: Added test to FluxCircuitBreakerTest to verify that an er…
Browse files Browse the repository at this point in the history
…ror is propagated when you subscribe to Flux.error, but the error is not thrown onSubscribe.
  • Loading branch information
Robert Winkler committed Mar 15, 2018
1 parent 81d6208 commit 43fa69d
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ public void shouldPropagateError() {
assertSingleFailedCall();
}

@Test
public void shouldPropagateErrorWhenErrorNotOnSubscribe() {
StepVerifier.create(
Flux.error(new IOException("BAM!"), true)
.transform(CircuitBreakerOperator.of(circuitBreaker)))
.expectError(IOException.class)
.verify(Duration.ofSeconds(1));

assertSingleFailedCall();
}

@Test
public void shouldEmitErrorWithCircuitBreakerOpenException() {
circuitBreaker.transitionToOpenState();
Expand Down

0 comments on commit 43fa69d

Please sign in to comment.