BalancingHttpClientConfig { @Config("http-client.retry-budget.ratio-period") @ConfigDescription("The time over which initial requests are considered when calculating retry budgets") public BalancingHttpClientConfig setRetryBudgetRatioPeriod(Duration retryBudgetRatioPeriod) { this.retryBudgetRatioPeriod = retryBudgetRatioPeriod; 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 TestRetryBudgetRatioPeriodBeanValidation() { assertValidates(new BalancingHttpClientConfig().setRetryBudgetRatioPeriod(new Duration(1, SECONDS))); assertFailsValidation(new BalancingHttpClientConfig().setRetryBudgetRatioPeriod(new Duration(999, MILLISECONDS)), "retryBudgetRatioPeriod", "{com.proofpoint.units.MinDuration.message}", MinDuration.class); assertValidates(new BalancingHttpClientConfig().setRetryBudgetRatioPeriod(new Duration(1, MINUTES))); assertFailsValidation(new BalancingHttpClientConfig().setRetryBudgetRatioPeriod(new Duration(60001, MILLISECONDS)), "retryBudgetRatioPeriod", "{com.proofpoint.units.MaxDuration.message}", MaxDuration.class); }