@Test public void testToString() { CircuitBreakerConfig config = custom() .slidingWindowSize(5) .recordExceptions(RuntimeException.class) .automaticTransitionFromOpenToHalfOpenEnabled(true) .slidingWindowType(SlidingWindowType.TIME_BASED).build(); String result = config.toString(); assertThat(result).startsWith("CircuitBreakerConfig {"); assertThat(result).contains("slidingWindowSize=5"); assertThat(result).contains("recordExceptions=[class java.lang.RuntimeException]"); assertThat(result).contains("automaticTransitionFromOpenToHalfOpenEnabled=true"); assertThat(result).contains("slidingWindowType=TIME_BASED"); assertThat(result).endsWith("}"); }
@Override public String toString() { StringBuilder circuitBreakerConfig = new StringBuilder("CircuitBreakerConfig {"); circuitBreakerConfig.append("recordExceptionPredicate="); circuitBreakerConfig.append(recordExceptionPredicate); circuitBreakerConfig.append(", ignoreExceptionPredicate="); circuitBreakerConfig.append(ignoreExceptionPredicate); circuitBreakerConfig.append(", recordExceptions="); circuitBreakerConfig.append(Arrays.toString(recordExceptions)); circuitBreakerConfig.append(", ignoreExceptions="); circuitBreakerConfig.append(Arrays.toString(ignoreExceptions)); circuitBreakerConfig.append(", failureRateThreshold="); circuitBreakerConfig.append(failureRateThreshold); circuitBreakerConfig.append(", permittedNumberOfCallsInHalfOpenState="); circuitBreakerConfig.append(permittedNumberOfCallsInHalfOpenState); circuitBreakerConfig.append(", slidingWindowSize="); circuitBreakerConfig.append(slidingWindowSize); circuitBreakerConfig.append(", slidingWindowType="); circuitBreakerConfig.append(slidingWindowType); circuitBreakerConfig.append(", minimumNumberOfCalls="); circuitBreakerConfig.append(minimumNumberOfCalls); circuitBreakerConfig.append(", writableStackTraceEnabled="); circuitBreakerConfig.append(writableStackTraceEnabled); circuitBreakerConfig.append(", automaticTransitionFromOpenToHalfOpenEnabled="); circuitBreakerConfig.append(automaticTransitionFromOpenToHalfOpenEnabled); circuitBreakerConfig.append(", waitIntervalFunctionInOpenState="); circuitBreakerConfig.append(waitIntervalFunctionInOpenState); circuitBreakerConfig.append(", slowCallRateThreshold="); circuitBreakerConfig.append(slowCallRateThreshold); circuitBreakerConfig.append(", slowCallDurationThreshold="); circuitBreakerConfig.append(slowCallDurationThreshold); circuitBreakerConfig.append("}"); return circuitBreakerConfig.toString(); }
CircuitBreakerConfig implements Serializable { @Override public String toString() { StringBuilder circuitBreakerConfig = new StringBuilder("CircuitBreakerConfig {"); circuitBreakerConfig.append("recordExceptionPredicate="); circuitBreakerConfig.append(recordExceptionPredicate); circuitBreakerConfig.append(", ignoreExceptionPredicate="); circuitBreakerConfig.append(ignoreExceptionPredicate); circuitBreakerConfig.append(", recordExceptions="); circuitBreakerConfig.append(Arrays.toString(recordExceptions)); circuitBreakerConfig.append(", ignoreExceptions="); circuitBreakerConfig.append(Arrays.toString(ignoreExceptions)); circuitBreakerConfig.append(", failureRateThreshold="); circuitBreakerConfig.append(failureRateThreshold); circuitBreakerConfig.append(", permittedNumberOfCallsInHalfOpenState="); circuitBreakerConfig.append(permittedNumberOfCallsInHalfOpenState); circuitBreakerConfig.append(", slidingWindowSize="); circuitBreakerConfig.append(slidingWindowSize); circuitBreakerConfig.append(", slidingWindowType="); circuitBreakerConfig.append(slidingWindowType); circuitBreakerConfig.append(", minimumNumberOfCalls="); circuitBreakerConfig.append(minimumNumberOfCalls); circuitBreakerConfig.append(", writableStackTraceEnabled="); circuitBreakerConfig.append(writableStackTraceEnabled); circuitBreakerConfig.append(", automaticTransitionFromOpenToHalfOpenEnabled="); circuitBreakerConfig.append(automaticTransitionFromOpenToHalfOpenEnabled); circuitBreakerConfig.append(", waitIntervalFunctionInOpenState="); circuitBreakerConfig.append(waitIntervalFunctionInOpenState); circuitBreakerConfig.append(", slowCallRateThreshold="); circuitBreakerConfig.append(slowCallRateThreshold); circuitBreakerConfig.append(", slowCallDurationThreshold="); circuitBreakerConfig.append(slowCallDurationThreshold); circuitBreakerConfig.append("}"); return circuitBreakerConfig.toString(); } }
CircuitBreakerConfig implements Serializable { @Override public String toString() { StringBuilder circuitBreakerConfig = new StringBuilder("CircuitBreakerConfig {"); circuitBreakerConfig.append("recordExceptionPredicate="); circuitBreakerConfig.append(recordExceptionPredicate); circuitBreakerConfig.append(", ignoreExceptionPredicate="); circuitBreakerConfig.append(ignoreExceptionPredicate); circuitBreakerConfig.append(", recordExceptions="); circuitBreakerConfig.append(Arrays.toString(recordExceptions)); circuitBreakerConfig.append(", ignoreExceptions="); circuitBreakerConfig.append(Arrays.toString(ignoreExceptions)); circuitBreakerConfig.append(", failureRateThreshold="); circuitBreakerConfig.append(failureRateThreshold); circuitBreakerConfig.append(", permittedNumberOfCallsInHalfOpenState="); circuitBreakerConfig.append(permittedNumberOfCallsInHalfOpenState); circuitBreakerConfig.append(", slidingWindowSize="); circuitBreakerConfig.append(slidingWindowSize); circuitBreakerConfig.append(", slidingWindowType="); circuitBreakerConfig.append(slidingWindowType); circuitBreakerConfig.append(", minimumNumberOfCalls="); circuitBreakerConfig.append(minimumNumberOfCalls); circuitBreakerConfig.append(", writableStackTraceEnabled="); circuitBreakerConfig.append(writableStackTraceEnabled); circuitBreakerConfig.append(", automaticTransitionFromOpenToHalfOpenEnabled="); circuitBreakerConfig.append(automaticTransitionFromOpenToHalfOpenEnabled); circuitBreakerConfig.append(", waitIntervalFunctionInOpenState="); circuitBreakerConfig.append(waitIntervalFunctionInOpenState); circuitBreakerConfig.append(", slowCallRateThreshold="); circuitBreakerConfig.append(slowCallRateThreshold); circuitBreakerConfig.append(", slowCallDurationThreshold="); circuitBreakerConfig.append(slowCallDurationThreshold); circuitBreakerConfig.append("}"); return circuitBreakerConfig.toString(); } private  CircuitBreakerConfig(); }
CircuitBreakerConfig implements Serializable { @Override public String toString() { StringBuilder circuitBreakerConfig = new StringBuilder("CircuitBreakerConfig {"); circuitBreakerConfig.append("recordExceptionPredicate="); circuitBreakerConfig.append(recordExceptionPredicate); circuitBreakerConfig.append(", ignoreExceptionPredicate="); circuitBreakerConfig.append(ignoreExceptionPredicate); circuitBreakerConfig.append(", recordExceptions="); circuitBreakerConfig.append(Arrays.toString(recordExceptions)); circuitBreakerConfig.append(", ignoreExceptions="); circuitBreakerConfig.append(Arrays.toString(ignoreExceptions)); circuitBreakerConfig.append(", failureRateThreshold="); circuitBreakerConfig.append(failureRateThreshold); circuitBreakerConfig.append(", permittedNumberOfCallsInHalfOpenState="); circuitBreakerConfig.append(permittedNumberOfCallsInHalfOpenState); circuitBreakerConfig.append(", slidingWindowSize="); circuitBreakerConfig.append(slidingWindowSize); circuitBreakerConfig.append(", slidingWindowType="); circuitBreakerConfig.append(slidingWindowType); circuitBreakerConfig.append(", minimumNumberOfCalls="); circuitBreakerConfig.append(minimumNumberOfCalls); circuitBreakerConfig.append(", writableStackTraceEnabled="); circuitBreakerConfig.append(writableStackTraceEnabled); circuitBreakerConfig.append(", automaticTransitionFromOpenToHalfOpenEnabled="); circuitBreakerConfig.append(automaticTransitionFromOpenToHalfOpenEnabled); circuitBreakerConfig.append(", waitIntervalFunctionInOpenState="); circuitBreakerConfig.append(waitIntervalFunctionInOpenState); circuitBreakerConfig.append(", slowCallRateThreshold="); circuitBreakerConfig.append(slowCallRateThreshold); circuitBreakerConfig.append(", slowCallDurationThreshold="); circuitBreakerConfig.append(slowCallDurationThreshold); circuitBreakerConfig.append("}"); return circuitBreakerConfig.toString(); } 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(); }
CircuitBreakerConfig implements Serializable { @Override public String toString() { StringBuilder circuitBreakerConfig = new StringBuilder("CircuitBreakerConfig {"); circuitBreakerConfig.append("recordExceptionPredicate="); circuitBreakerConfig.append(recordExceptionPredicate); circuitBreakerConfig.append(", ignoreExceptionPredicate="); circuitBreakerConfig.append(ignoreExceptionPredicate); circuitBreakerConfig.append(", recordExceptions="); circuitBreakerConfig.append(Arrays.toString(recordExceptions)); circuitBreakerConfig.append(", ignoreExceptions="); circuitBreakerConfig.append(Arrays.toString(ignoreExceptions)); circuitBreakerConfig.append(", failureRateThreshold="); circuitBreakerConfig.append(failureRateThreshold); circuitBreakerConfig.append(", permittedNumberOfCallsInHalfOpenState="); circuitBreakerConfig.append(permittedNumberOfCallsInHalfOpenState); circuitBreakerConfig.append(", slidingWindowSize="); circuitBreakerConfig.append(slidingWindowSize); circuitBreakerConfig.append(", slidingWindowType="); circuitBreakerConfig.append(slidingWindowType); circuitBreakerConfig.append(", minimumNumberOfCalls="); circuitBreakerConfig.append(minimumNumberOfCalls); circuitBreakerConfig.append(", writableStackTraceEnabled="); circuitBreakerConfig.append(writableStackTraceEnabled); circuitBreakerConfig.append(", automaticTransitionFromOpenToHalfOpenEnabled="); circuitBreakerConfig.append(automaticTransitionFromOpenToHalfOpenEnabled); circuitBreakerConfig.append(", waitIntervalFunctionInOpenState="); circuitBreakerConfig.append(waitIntervalFunctionInOpenState); circuitBreakerConfig.append(", slowCallRateThreshold="); circuitBreakerConfig.append(slowCallRateThreshold); circuitBreakerConfig.append(", slowCallDurationThreshold="); circuitBreakerConfig.append(slowCallDurationThreshold); circuitBreakerConfig.append("}"); return circuitBreakerConfig.toString(); } 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; }