Skip to content

Commit

Permalink
Issue ReactiveX#212: Added test to FluxCircuitBreakerTest to verify t…
Browse files Browse the repository at this point in the history
…hat a CircuitBreakerException is thrown when you subscribe to Flux.error.
  • Loading branch information
Robert Winkler committed Mar 15, 2018
1 parent d3236e2 commit 81d6208
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ Core modules:

Add-on modules

* resilience4j-reactor: Spring Reactor adapter
* resilience4j-rxjava2: RxJava2 adapter
* resilience4j-micrometer: Micrometer Metrics exporter
* resilience4j-metrics: Dropwizard Metrics exporter
* resilience4j-prometheus: Prometheus Metrics exporter
* resilience4j-spring-boot: Spring Boot Starter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@ public void shouldEmitErrorWithCircuitBreakerOpenException() {
assertNoRegisteredCall();
}

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

assertNoRegisteredCall();
}

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

0 comments on commit 81d6208

Please sign in to comment.