CircuitBreakerBuilder { public CircuitBreakerBuilder minimumRequestThreshold(long minimumRequestThreshold) { if (minimumRequestThreshold < 0) { throw new IllegalArgumentException( "minimumRequestThreshold: " + minimumRequestThreshold + " (expected: >= 0)"); } this.minimumRequestThreshold = minimumRequestThreshold; return this; } CircuitBreakerBuilder(String name);   CircuitBreakerBuilder(); CircuitBreakerBuilder failureRateThreshold(double failureRateThreshold); CircuitBreakerBuilder minimumRequestThreshold(long minimumRequestThreshold); CircuitBreakerBuilder trialRequestInterval(Duration trialRequestInterval); CircuitBreakerBuilder trialRequestIntervalMillis(long trialRequestIntervalMillis); CircuitBreakerBuilder circuitOpenWindow(Duration circuitOpenWindow); CircuitBreakerBuilder circuitOpenWindowMillis(long circuitOpenWindowMillis); CircuitBreakerBuilder counterSlidingWindow(Duration counterSlidingWindow); CircuitBreakerBuilder counterSlidingWindowMillis(long counterSlidingWindowMillis); CircuitBreakerBuilder counterUpdateInterval(Duration counterUpdateInterval); CircuitBreakerBuilder counterUpdateIntervalMillis(long counterUpdateIntervalMillis); CircuitBreakerBuilder listener(CircuitBreakerListener listener); CircuitBreaker build();  }
@Test void testMinimumRequestThreshold() { final CircuitBreakerConfig config1 = confOf(builder().minimumRequestThreshold(Long.MAX_VALUE).build()); assertThat(config1.minimumRequestThreshold()).isEqualTo(Long.MAX_VALUE); final CircuitBreakerConfig config2 = confOf(builder().minimumRequestThreshold(0).build()); assertThat(config2.minimumRequestThreshold()).isEqualTo(0L); }
@Test void testMinimumRequestThresholdWithInvalidArgument() { assertThatThrownBy(() -> builder().minimumRequestThreshold(-1)) .isInstanceOf(IllegalArgumentException.class); }