@Test
public void throwExceptionIfCircuitBreakerIsOpen_schedules_half_open_check_and_does_not_explode_if_circuit_is_half_open() {

    // given
    Whitebox.setInternalState(cbSpy, "currentState", State.OPEN);
    ((AtomicBoolean) Whitebox.getInternalState(cbSpy, "halfOpenAllowSingleCall")).set(true);
    // when
    Throwable cbExplosion = catchThrowable(cbSpy::throwExceptionIfCircuitBreakerIsOpen);
    // then
    assertThat(cbExplosion).isNull();
    verify(cbSpy).scheduleHalfOpenStateTimeout();
}