BAEL-7001: fixed formatting
This commit is contained in:
parent
06943519f8
commit
210eaf2c0b
@ -1,16 +1,19 @@
|
|||||||
package com.baeldung.concurrent.completablefuture.retry;
|
package com.baeldung.concurrent.completablefuture.retry;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryExceptionallyAsync;
|
||||||
import org.junit.jupiter.api.Test;
|
import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryNesting;
|
||||||
|
import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryTask;
|
||||||
|
import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.retryUnsafe;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
||||||
|
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.CompletionException;
|
import java.util.concurrent.CompletionException;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import static com.baeldung.concurrent.completablefuture.retry.RetryCompletableFuture.*;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import org.junit.jupiter.api.Test;
|
||||||
import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
|
||||||
|
|
||||||
class RetryCompletableFutureUnitTest {
|
class RetryCompletableFutureUnitTest {
|
||||||
private AtomicInteger retriesCounter = new AtomicInteger(0);
|
private AtomicInteger retriesCounter = new AtomicInteger(0);
|
||||||
@ -38,8 +41,7 @@ class RetryCompletableFutureUnitTest {
|
|||||||
|
|
||||||
CompletableFuture<Integer> result = retryTask(codeToRun, 3);
|
CompletableFuture<Integer> result = retryTask(codeToRun, 3);
|
||||||
|
|
||||||
assertThatThrownBy(result::join)
|
assertThatThrownBy(result::join).isInstanceOf(CompletionException.class)
|
||||||
.isInstanceOf(CompletionException.class)
|
|
||||||
.hasMessageContaining("IllegalStateException: Task failed after 3 attempts");
|
.hasMessageContaining("IllegalStateException: Task failed after 3 attempts");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user