ThreadPoolBulkheadConfig { @Override public String toString() { final StringBuilder sb = new StringBuilder("ThreadPoolBulkheadConfig{"); sb.append("maxThreadPoolSize=").append(maxThreadPoolSize); sb.append(", coreThreadPoolSize=").append(coreThreadPoolSize); sb.append(", queueCapacity=").append(queueCapacity); sb.append(", keepAliveDuration=").append(keepAliveDuration); sb.append(", writableStackTraceEnabled=").append(writableStackTraceEnabled); sb.append(", contextPropagators=").append(contextPropagators); sb.append('}'); return sb.toString(); } private  ThreadPoolBulkheadConfig(); static Builder custom(); static Builder from(ThreadPoolBulkheadConfig threadPoolBulkheadConfig); static ThreadPoolBulkheadConfig ofDefaults(); Duration getKeepAliveDuration(); int getQueueCapacity(); int getMaxThreadPoolSize(); int getCoreThreadPoolSize(); boolean isWritableStackTraceEnabled(); List<ContextPropagator> getContextPropagator(); @Override String toString(); static final int DEFAULT_QUEUE_CAPACITY; static final Duration DEFAULT_KEEP_ALIVE_DURATION; static final int DEFAULT_CORE_THREAD_POOL_SIZE; static final int DEFAULT_MAX_THREAD_POOL_SIZE; static final boolean DEFAULT_WRITABLE_STACK_TRACE_ENABLED; }
@Test public void testToString() { int maxThreadPoolSize = 20; int coreThreadPoolSize = 2; long maxWait = 555; int queueCapacity = 50; ThreadPoolBulkheadConfig config = ThreadPoolBulkheadConfig.custom() .maxThreadPoolSize(maxThreadPoolSize) .coreThreadPoolSize(coreThreadPoolSize) .queueCapacity(queueCapacity) .keepAliveDuration(Duration.ofMillis(maxWait)) .writableStackTraceEnabled(false) .contextPropagator(TestCtxPropagator2.class) .build(); String result = config.toString(); assertThat(result).startsWith("ThreadPoolBulkheadConfig{"); assertThat(result).contains("maxThreadPoolSize=20"); assertThat(result).contains("coreThreadPoolSize=2"); assertThat(result).contains("queueCapacity=50"); assertThat(result).contains("keepAliveDuration=PT0.555S"); assertThat(result).contains("writableStackTraceEnabled=false"); assertThat(result).contains("contextPropagators=[io.github.resilience4j.bulkhead.ThreadPoolBulkheadConfigTest$TestCtxPropagator2"); assertThat(result).endsWith("}"); }