BalancingHttpClientConfig { @Config("http-client.retry-budget.min-per-second") @ConfigDescription("Additional number of retries permitted per second") public BalancingHttpClientConfig setRetryBudgetMinPerSecond(int retryBudgetMinPerSecond) { this.retryBudgetMinPerSecond = retryBudgetMinPerSecond; return this; }  @Min(1) int getMaxAttempts(); @Config("http-client.max-attempts") BalancingHttpClientConfig setMaxAttempts(int maxAttempts); Duration getMinBackoff(); @Config("http-client.min-backoff") @ConfigDescription("Minimum backoff delay before a retry") BalancingHttpClientConfig setMinBackoff(Duration minBackoff); Duration getMaxBackoff(); @Config("http-client.max-backoff") @ConfigDescription("Maximum backoff delay before a retry") BalancingHttpClientConfig setMaxBackoff(Duration maxBackoff); @Min(0) @Max(1000) BigDecimal getRetryBudgetRatio(); @Config("http-client.retry-budget.ratio") @ConfigDescription("The ratio of permitted retries to initial requests") BalancingHttpClientConfig setRetryBudgetRatio(BigDecimal retryBudgetRatio); @MinDuration("1s") @MaxDuration("60s") Duration getRetryBudgetRatioPeriod(); @Config("http-client.retry-budget.ratio-period") @ConfigDescription("The time over which initial requests are considered when calculating retry budgets") BalancingHttpClientConfig setRetryBudgetRatioPeriod(Duration retryBudgetRatioPeriod); @Min(1) int getRetryBudgetMinPerSecond(); @Config("http-client.retry-budget.min-per-second") @ConfigDescription("Additional number of retries permitted per second") BalancingHttpClientConfig setRetryBudgetMinPerSecond(int retryBudgetMinPerSecond); @AssertFalse boolean isMaxBackoffLessThanMinBackoff();  }
@Test public void TestRetryBudgetMinPerSecondBeanValidation() { assertValidates(new BalancingHttpClientConfig().setRetryBudgetMinPerSecond(1)); assertFailsValidation(new BalancingHttpClientConfig().setRetryBudgetMinPerSecond(0), "retryBudgetMinPerSecond", "must be greater than or equal to 1", Min.class); }