Package org.apache.flink.core.testutils
Class FlinkCompletableFutureAssert<T>
- java.lang.Object
-
- org.assertj.core.api.AbstractAssert<SELF,CompletableFuture<RESULT>>
-
- org.assertj.core.api.AbstractCompletableFutureAssert<FlinkCompletableFutureAssert<T>,T>
-
- org.apache.flink.core.testutils.FlinkCompletableFutureAssert<T>
-
- Type Parameters:
T- type of the value contained in theCompletableFuture.
- All Implemented Interfaces:
org.assertj.core.api.Assert<FlinkCompletableFutureAssert<T>,CompletableFuture<T>>,org.assertj.core.api.Descriptable<FlinkCompletableFutureAssert<T>>,org.assertj.core.api.ExtensionPoints<FlinkCompletableFutureAssert<T>,CompletableFuture<T>>
public class FlinkCompletableFutureAssert<T> extends org.assertj.core.api.AbstractCompletableFutureAssert<FlinkCompletableFutureAssert<T>,T>
Enhanced version ofCompletableFutureAssert, that allows asserting futures without relying on timeouts.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFlinkCompletableFutureAssert.WithThrowableA strongly typed alternative toWithThrowable.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FlinkCompletableFutureAssert.WithThrowableeventuallyFails()An equivalent ofAbstractCompletableFutureAssert.failsWithin(Duration), that doesn't rely on timeouts.<E extends Throwable>
org.assertj.core.api.ThrowableAssertAlternative<E>eventuallyFailsWith(Class<E> exceptionClass)An equivalent ofAbstractCompletableFutureAssert.failsWithin(Duration), that doesn't rely on timeouts.org.assertj.core.api.ObjectAssert<T>eventuallySucceeds()An equivalent ofAbstractCompletableFutureAssert.succeedsWithin(Duration), that doesn't rely on timeouts.FlinkCompletableFutureAssert<T>willNotCompleteWithin(java.time.Duration duration)Assert thatCompletableFuturewill not complete within a fixed duration.-
Methods inherited from class org.assertj.core.api.AbstractCompletableFutureAssert
failsWithin, failsWithin, hasFailed, hasFailedWithThrowableThat, hasNotFailed, isCancelled, isCompleted, isCompletedExceptionally, isCompletedWithValue, isCompletedWithValueMatching, isCompletedWithValueMatching, isDone, isNotCancelled, isNotCompleted, isNotCompletedExceptionally, isNotDone, newObjectAssert, succeedsWithin, succeedsWithin, succeedsWithin, succeedsWithin
-
Methods inherited from class org.assertj.core.api.AbstractAssert
areEqual, asInstanceOf, asList, assertionError, asString, describedAs, descriptionText, doesNotHave, doesNotHaveSameClassAs, doesNotHaveSameHashCodeAs, doesNotHaveToString, equals, extracting, extracting, failure, failureWithActualExpected, failWithActualExpectedAndMessage, failWithMessage, getWritableAssertionInfo, has, hashCode, hasSameClassAs, hasSameHashCodeAs, hasToString, inBinary, inHexadecimal, is, isElementOfCustomAssert, isEqualTo, isExactlyInstanceOf, isIn, isIn, isInstanceOf, isInstanceOfAny, isInstanceOfSatisfying, isNot, isNotEqualTo, isNotExactlyInstanceOf, isNotIn, isNotIn, isNotInstanceOf, isNotInstanceOfAny, isNotNull, isNotOfAnyClassIn, isNotSameAs, isNull, isOfAnyClassIn, isSameAs, matches, matches, newListAssertInstance, overridingErrorMessage, overridingErrorMessage, satisfies, satisfies, satisfies, satisfiesAnyOf, satisfiesAnyOf, satisfiesAnyOfForProxy, satisfiesForProxy, setCustomRepresentation, setDescriptionConsumer, setPrintAssertionsDescription, throwAssertionError, usingComparator, usingComparator, usingDefaultComparator, usingRecursiveComparison, usingRecursiveComparison, withFailMessage, withFailMessage, withRepresentation, withThreadDumpOnError
-
-
-
-
Method Detail
-
eventuallySucceeds
public org.assertj.core.api.ObjectAssert<T> eventuallySucceeds()
An equivalent ofAbstractCompletableFutureAssert.succeedsWithin(Duration), that doesn't rely on timeouts.- Returns:
- a new assertion object on the future's result
-
eventuallyFails
public FlinkCompletableFutureAssert.WithThrowable eventuallyFails()
An equivalent ofAbstractCompletableFutureAssert.failsWithin(Duration), that doesn't rely on timeouts.- Returns:
- a new assertion instance on the future's exception.
-
eventuallyFailsWith
public <E extends Throwable> org.assertj.core.api.ThrowableAssertAlternative<E> eventuallyFailsWith(Class<E> exceptionClass)
An equivalent ofAbstractCompletableFutureAssert.failsWithin(Duration), that doesn't rely on timeouts.- Type Parameters:
E- type of the exception we expect the future to complete with- Parameters:
exceptionClass- type of the exception we expect the future to complete with- Returns:
- a new assertion instance on the future's exception.
-
willNotCompleteWithin
public FlinkCompletableFutureAssert<T> willNotCompleteWithin(java.time.Duration duration)
Assert thatCompletableFuturewill not complete within a fixed duration.This is a replacement for
FlinkMatchers.willNotComplete(Duration)in assertj.- Returns:
thisassertion object.
-
-