Skip to content

Commit

Permalink
spring-projectsGH-427: Fix indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
aftabshk committed May 10, 2024
1 parent 41b3530 commit 2b8feb7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@
* Evaluates to a value. In the exponential case ({@link #multiplier()} > 1.0) set
* this to true to have the backoff delays randomized, so that the maximum delay is
* multiplier times the previous delay and the distribution is uniform between the two
* values. This expression is always evaluated during initialization. If the expression
* returns true then {@link org.springframework.retry.backoff.ExponentialRandomBackOffPolicy}
* is used else {@link org.springframework.retry.backoff.ExponentialBackOffPolicy} is used.
* values. This expression is always evaluated during initialization. If the
* expression returns true then
* {@link org.springframework.retry.backoff.ExponentialRandomBackOffPolicy} is used
* else {@link org.springframework.retry.backoff.ExponentialBackOffPolicy} is used.
* @return the flag to signal randomization is required (default false)
*/
String randomExpression() default "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ public void shouldCreateExponentialRandomBackOffWhenProvidedRandomSupplier() {
public void shouldCreateExponentialRandomBackOffWithProvidedSuppliers() {
Sleeper mockSleeper = mock(Sleeper.class);
BackOffPolicy backOffPolicy = BackOffPolicyBuilder.newBuilder()
.delaySupplier(() -> 10000L)
.maxDelaySupplier(() -> 100000L)
.multiplierSupplier(() -> 10d)
.randomSupplier(() -> true)
.sleeper(mockSleeper)
.build();
.delaySupplier(() -> 10000L)
.maxDelaySupplier(() -> 100000L)
.multiplierSupplier(() -> 10d)
.randomSupplier(() -> true)
.sleeper(mockSleeper)
.build();

assertThat(ExponentialRandomBackOffPolicy.class.isAssignableFrom(backOffPolicy.getClass())).isTrue();
ExponentialRandomBackOffPolicy policy = (ExponentialRandomBackOffPolicy) backOffPolicy;
Expand Down Expand Up @@ -168,12 +168,12 @@ public void shouldCreateExponentialBackOffWhenProvidedRandomSupplier() {
public void shouldCreateExponentialBackOffWithProvidedSuppliers() {
Sleeper mockSleeper = mock(Sleeper.class);
BackOffPolicy backOffPolicy = BackOffPolicyBuilder.newBuilder()
.delaySupplier(() -> 10000L)
.maxDelaySupplier(() -> 100000L)
.multiplierSupplier(() -> 10d)
.randomSupplier(() -> false)
.sleeper(mockSleeper)
.build();
.delaySupplier(() -> 10000L)
.maxDelaySupplier(() -> 100000L)
.multiplierSupplier(() -> 10d)
.randomSupplier(() -> false)
.sleeper(mockSleeper)
.build();

assertThat(backOffPolicy instanceof ExponentialRandomBackOffPolicy).isFalse();
assertThat(ExponentialBackOffPolicy.class.isAssignableFrom(backOffPolicy.getClass())).isTrue();
Expand All @@ -182,4 +182,5 @@ public void shouldCreateExponentialBackOffWithProvidedSuppliers() {
assertThat(policy.getMaxInterval()).isEqualTo(100000);
assertThat(policy.getMultiplier()).isEqualTo(10);
}

}

0 comments on commit 2b8feb7

Please sign in to comment.