Package org.apache.flink.core.testutils
Class FlinkAssertions
java.lang.Object
org.apache.flink.core.testutils.FlinkAssertions
Some reusable assertions and utilities for AssertJ.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic org.assertj.core.api.ThrowingConsumer<? super Throwable>anyCauseMatches(Class<? extends Throwable> clazz) static org.assertj.core.api.ThrowingConsumer<? super Throwable>anyCauseMatches(Class<? extends Throwable> clazz, String containsMessage) static org.assertj.core.api.ThrowingConsumer<? super Throwable>anyCauseMatches(String containsMessage) static org.assertj.core.api.ListAssert<Throwable>Shorthand to assert chain of causes.static <T> FlinkCompletableFutureAssert<T>assertThatFuture(CompletableFuture<T> actual) Create assertion forCompletableFuture.static <T> FlinkCompletableFutureAssert<T>assertThatFuture(CompletionStage<T> actual) Create assertion forCompletionStage.chainOfCauses(Throwable throwable) You can use this method in combination withAbstractAssert.extracting(Function, AssertFactory)to perform assertions on a chain of causes.
-
Field Details
-
Method Details
-
anyCauseMatches
-
anyCauseMatches
-
anyCauseMatches
-
assertThatChainOfCauses
Shorthand to assert chain of causes. Same as:assertThat(throwable) .extracting(FlinkAssertions::chainOfCauses, FlinkAssertions.STREAM_THROWABLE) -
chainOfCauses
You can use this method in combination withAbstractAssert.extracting(Function, AssertFactory)to perform assertions on a chain of causes. For example:assertThat(throwable) .extracting(FlinkAssertions::chainOfCauses, FlinkAssertions.STREAM_THROWABLE)- Returns:
- the list is ordered from the current
Throwableup to the root cause.
-
assertThatFuture
Create assertion forCompletableFuture.- Type Parameters:
T- the type of the value contained in theCompletableFuture.- Parameters:
actual- the actual value.- Returns:
- the created assertion object.
-
assertThatFuture
Create assertion forCompletionStage.- Type Parameters:
T- the type of the value contained in theCompletionStage.- Parameters:
actual- the actual value.- Returns:
- the created assertion object.
-