@Test
public void executeBlockingCall_throws_CircuitBreakerTimeoutException_after_supplier_completes_if_supplier_takes_longer_than_callTimeout() {

    // given
    long callTimeoutMillis = 50;
    long callExecutionTimeMillis = 100;
    Whitebox
        .setInternalState(cbSpy, "callTimeoutNanos", Optional.of(Duration.ofMillis(callTimeoutMillis).toNanos()));
    Callable<String> supplier = () -> {
        try {
            Thread.sleep(callExecutionTimeMillis);
        }
        catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        return "foo";
    };
    // when
    long startTimeMillis = System.currentTimeMillis();
    Throwable cbExplosion = catchThrowable(() -> cbSpy.executeBlockingCall(supplier));
    long endTimeMillis = System.currentTimeMillis();
    // then
    assertThat(cbExplosion)
        .isNotNull()
        .isInstanceOf(CircuitBreakerTimeoutException.class);
    assertThat((endTimeMillis - startTimeMillis)).isGreaterThanOrEqualTo(callExecutionTimeMillis);
}