CompletableFuture.
CompletableFuture.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Futures |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public WithThrowable | Returns: a new assertion instance on the future's exception.the maximum time to wait timeout)Checks that the future does not complete within the given time (by calling |
| public WithThrowable | Returns: a new assertion instance on the future's exception.the maximum time to wait timeout, TimeUnit the time unit unit)Checks that the future does not complete within the given time (by calling |
| public SELF | Returns: this assertion object.
Deprecated
Combine isCompletedExceptionally with isNotCancelled instead:
|
| public AbstractThrowableAssert | Returns: an exception assertion object.
Deprecated
Although not 100% the same, consider using
|
| public SELF | Returns: this assertion object.
Deprecated
Use matches with the following combination instead:
|
| private WithThrowable | |
| private WithThrowable | |
| private ObjectAssert | |
| private ObjectAssert | |
| public SELF | |
| public SELF | Returns: this assertion object.Verifies that the |
| public SELF | Returns: this assertion object.Verifies that the |
| public SELF | Returns: this assertion object.the expected result value of the expected)CompletableFuture.Verifies that the |
| public SELF | Returns: this assertion object.the predicate)Predicate to apply.Verifies that the |
| public SELF | Returns: this assertion object.the predicate, String Predicate to apply on the resulting value.the description)Predicate description.Verifies that the |
| private SELF | |
| public SELF | Returns: this assertion object.Verifies that the |
| public SELF | Returns: this assertion object.Verifies that the |
| public SELF | Returns: this assertion object.Verifies that the |
| public SELF | Returns: this assertion object.Verifies that the |
| public SELF | |
| protected ObjectAssert | |
| public ObjectAssert | Returns: a new assertion object on the future's result.the maximum time to wait timeout)Waits if necessary for at most the given time for this future to complete, and then returns its result for further assertions. |
| public ObjectAssert | Returns: a new assertion object on the future's result.the maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit)Waits if necessary for at most the given time for this future to complete, and then returns its result for further assertions. |
| public < the type of the resulting ASSERT extends AbstractAssertAssert | Returns: a new narrowedAssert instance for assertions chaining on the value of the CompletableFuturethe maximum time to wait timeout, InstanceOfAssertFactory<RESULT, ASSERT> the factory which verifies the type and creates the new assertFactory)AssertWaits if necessary for at most the given time for this future to complete, the |
| public < the type of the resulting ASSERT extends AbstractAssertAssert | Returns: a new narrowedAssert instance for assertions chaining on the value of the CompletableFuturethe maximum time to wait timeout, TimeUnit the time unit of the timeout argument unit, InstanceOfAssertFactory<RESULT, ASSERT> the factory which verifies the type and creates the new assertFactory)AssertWaits if necessary for at most the given time for this future to complete, the |
| futures | back to summary |
|---|---|
| pack-priv Futures futures
| |
| AbstractCompletableFutureAssert | back to summary |
|---|---|
| protected AbstractCompletableFutureAssert(CompletableFuture<RESULT> actual, Class<?> selfType) | |
| failsWithin | back to summary |
|---|---|
| public WithThrowable failsWithin(Duration timeout) Checks that the future does not complete within the given time (by calling WARNING
Examples:
| |
| failsWithin | back to summary |
|---|---|
| public WithThrowable failsWithin(long timeout, TimeUnit unit) Checks that the future does not complete within the given time (by calling WARNING
Examples:
| |
| hasFailed | back to summary |
|---|---|
| public SELF hasFailed()
Deprecated Combine isCompletedExceptionally with isNotCancelled instead:
This assertion is deprecated to change the semantics of failed to correspond to CompletableFuture#get() failing.
Original javadoc
Verifies that the
Assertion will pass :
Assertion will fail :
| |
| hasFailedWithThrowableThat | back to summary |
|---|---|
| public AbstractThrowableAssert Deprecated
Although not 100% the same, consider using
This assertion is deprecated because it relies on hasFailed() semantics which we want to move away from (they
are not clear!) and to use failure semantics corresponding to CompletableFuture#get() failing.
Original javadoc
Verifies that the Assertion will pass :
Assertion will fail :
| |
| hasNotFailed | back to summary |
|---|---|
| public SELF hasNotFailed()
Deprecated Use matches with the following combination instead:
This assertion is deprecated because its semantic is not obvious.
Original javadoc
Verifies that the Assertion will pass :
Assertion will fail :
| |
| internalFailsWithin | back to summary |
|---|---|
| private WithThrowable internalFailsWithin(Duration timeout) | |
| internalFailsWithin | back to summary |
|---|---|
| private WithThrowable internalFailsWithin(long timeout, TimeUnit unit) | |
| internalSucceedsWithin | back to summary |
|---|---|
| private ObjectAssert | |
| internalSucceedsWithin | back to summary |
|---|---|
| private ObjectAssert | |
| isCancelled | back to summary |
|---|---|
| public SELF isCancelled() Verifies that the Assertion will pass :
Assertion will fail :
| |
| isCompleted | back to summary |
|---|---|
| public SELF isCompleted() Verifies that the Assertion will pass :
Assertion will fail :
| |
| isCompletedExceptionally | back to summary |
|---|---|
| public SELF isCompletedExceptionally() Verifies that the Possible causes include cancellation, explicit invocation of completeExceptionally, and abrupt termination of a CompletionStage action. Assertion will pass :
Assertion will fail :
| |
| isCompletedWithValue | back to summary |
|---|---|
| public SELF isCompletedWithValue(RESULT expected) Verifies that the Assertion will pass :
Assertion will fail :
| |
| isCompletedWithValueMatching | back to summary |
|---|---|
| public SELF isCompletedWithValueMatching(Predicate<? super RESULT> predicate) Verifies that the Assertion will pass :
Assertion will fail :
| |
| isCompletedWithValueMatching | back to summary |
|---|---|
| public SELF isCompletedWithValueMatching(Predicate<? super RESULT> predicate, String description) Verifies that the Assertion will pass :
Assertion will fail :
Error message is:
| |
| isCompletedWithValueMatching | back to summary |
|---|---|
| private SELF isCompletedWithValueMatching(Predicate<? super RESULT> predicate, PredicateDescription description) | |
| isDone | back to summary |
|---|---|
| public SELF isDone() Verifies that the Assertion will pass :
Assertion will fail :
| |
| isNotCancelled | back to summary |
|---|---|
| public SELF isNotCancelled() Verifies that the Assertion will pass :
Assertion will fail :
| |
| isNotCompleted | back to summary |
|---|---|
| public SELF isNotCompleted() Verifies that the Assertion will pass :
Assertion will fail :
| |
| isNotCompletedExceptionally | back to summary |
|---|---|
| public SELF isNotCompletedExceptionally() Verifies that the Assertion will pass :
Assertion will fail :
| |
| isNotDone | back to summary |
|---|---|
| public SELF isNotDone() Verifies that the Assertion will pass :
Assertion will fail :
| |
| newObjectAssert | back to summary |
|---|---|
| protected ObjectAssert | |
| succeedsWithin | back to summary |
|---|---|
| public ObjectAssert Waits if necessary for at most the given time for this future to complete, and then returns its result for further assertions. If the future's result is not available for any reason an assertion error is thrown.
To get assertions for the future result's type use Examples:
| |
| succeedsWithin | back to summary |
|---|---|
| public ObjectAssert Waits if necessary for at most the given time for this future to complete, and then returns its result for further assertions. If the future's result is not available for any reason an assertion error is thrown.
To get assertions for the future result's type use Examples:
| |
| succeedsWithin | back to summary |
|---|---|
| public <ASSERT extends AbstractAssert Waits if necessary for at most the given time for this future to complete, the If the future's result is not available for any reason an assertion error is thrown. Examples:
| |
| succeedsWithin | back to summary |
|---|---|
| public <ASSERT extends AbstractAssert Waits if necessary for at most the given time for this future to complete, the If the future's result is not available for any reason an assertion error is thrown. Examples:
| |