CircuitBreakerConfig implements Serializable { public static Builder custom() { return new Builder(); } private  CircuitBreakerConfig(); static Builder custom(); static Builder from(CircuitBreakerConfig baseConfig); static CircuitBreakerConfig ofDefaults(); float getFailureRateThreshold(); @Deprecated Duration getWaitDurationInOpenState(); IntervalFunction getWaitIntervalFunctionInOpenState(); int getSlidingWindowSize(); Predicate<Throwable> getRecordExceptionPredicate(); Predicate<Throwable> getIgnoreExceptionPredicate(); Function<Clock, Long> getCurrentTimestampFunction(); TimeUnit getTimestampUnit(); boolean isAutomaticTransitionFromOpenToHalfOpenEnabled(); int getMinimumNumberOfCalls(); boolean isWritableStackTraceEnabled(); int getPermittedNumberOfCallsInHalfOpenState(); SlidingWindowType getSlidingWindowType(); float getSlowCallRateThreshold(); Duration getSlowCallDurationThreshold(); Duration getMaxWaitDurationInHalfOpenState(); @Override String toString(); static final int DEFAULT_FAILURE_RATE_THRESHOLD; static final int DEFAULT_SLOW_CALL_RATE_THRESHOLD; static final int DEFAULT_WAIT_DURATION_IN_OPEN_STATE; static final int DEFAULT_PERMITTED_CALLS_IN_HALF_OPEN_STATE; static final int DEFAULT_MINIMUM_NUMBER_OF_CALLS; static final int DEFAULT_SLIDING_WINDOW_SIZE; static final int DEFAULT_SLOW_CALL_DURATION_THRESHOLD; static final int DEFAULT_WAIT_DURATION_IN_HALF_OPEN_STATE; static final SlidingWindowType DEFAULT_SLIDING_WINDOW_TYPE; static final boolean DEFAULT_WRITABLE_STACK_TRACE_ENABLED; }
@Test(expected = IllegalArgumentException.class) public void zeroMaxFailuresShouldFail() { custom().failureRateThreshold(0).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroWaitIntervalShouldFail() { custom().waitDurationInOpenState(Duration.ofMillis(0)).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroSlowCallDurationThresholdShouldFail() { custom().slowCallDurationThreshold(Duration.ofMillis(0)).build(); }
@Test(expected = IllegalArgumentException.class) @SuppressWarnings("deprecation") public void ringBufferSizeInHalfOpenStateBelowOneShouldFail() { custom().ringBufferSizeInHalfOpenState(0).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroPermittedNumberOfCallsInHalfOpenStateShouldFail() { custom().permittedNumberOfCallsInHalfOpenState(0).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroSlidingWindowSizeShouldFail() { custom().slidingWindow(0, 0, SlidingWindowType.COUNT_BASED).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroSlidingWindowSizeShouldFail2() { custom().slidingWindowSize(0).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroMinimumNumberOfCallsShouldFail() { custom().slidingWindow(2, 0, SlidingWindowType.COUNT_BASED).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroMinimumNumberOfCallsShouldFai2l() { custom().minimumNumberOfCalls(0).build(); }
@Test(expected = IllegalArgumentException.class) @SuppressWarnings("deprecation") public void zeroRingBufferSizeInClosedStateShouldFail() { custom().ringBufferSizeInClosedState(0).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroFailureRateThresholdShouldFail() { custom().failureRateThreshold(0).build(); }
@Test(expected = IllegalArgumentException.class) public void zeroSlowCallRateThresholdShouldFail() { custom().slowCallRateThreshold(0).build(); }
@Test(expected = IllegalArgumentException.class) public void failureRateThresholdAboveHundredShouldFail() { custom().failureRateThreshold(101).build(); }
@Test(expected = IllegalArgumentException.class) public void slowCallRateThresholdAboveHundredShouldFail() { custom().slowCallRateThreshold(101).build(); }
@Test(expected = IllegalArgumentException.class) public void maxWaitDurationInHalfOpenStateLessThanSecondShouldFail() { custom().maxWaitDurationInHalfOpenState(Duration.ZERO).build(); }