Class CompletableFutureAssertionsUtil.ExceptionContextAssertionBuilder
java.lang.Object
nl.pim16aap2.testing.assertions.CompletableFutureAssertionsUtil.ExceptionContextAssertionBuilder
- Enclosing class:
CompletableFutureAssertionsUtil
public static final class CompletableFutureAssertionsUtil.ExceptionContextAssertionBuilder
extends Object
A builder for assertions about the exception context of a
CompletableFuture.-
Method Summary
Modifier and TypeMethodDescriptionAssert that the exception context of theCompletableFuturematches the set values.withMessage(@Nullable String message) Set the expected message of the exception context.withMessage(String format, @Nullable Object @Nullable ... args) Set the expected message of the exception context.withTimeOut(long timeoutMs) Set the timeout for theCompletableFutureto assert on.
-
Method Details
-
withMessage
@CheckReturnValue public CompletableFutureAssertionsUtil.ExceptionContextAssertionBuilder withMessage(@Nullable String message) Set the expected message of the exception context.- Parameters:
message- The expected message.- Returns:
- This builder.
-
withMessage
@FormatMethod @CheckReturnValue public CompletableFutureAssertionsUtil.ExceptionContextAssertionBuilder withMessage(@FormatString String format, @Nullable Object @Nullable ... args) Set the expected message of the exception context.- Parameters:
format- The format of the expected message.args- The arguments to format the message with.- Returns:
- This builder.
-
withTimeOut
@CheckReturnValue public CompletableFutureAssertionsUtil.ExceptionContextAssertionBuilder withTimeOut(long timeoutMs) Set the timeout for theCompletableFutureto assert on.This defaults to 1000 milliseconds.
- Parameters:
timeoutMs- The timeout in milliseconds.- Returns:
- This builder.
-
thenAssert
Assert that the exception context of theCompletableFuturematches the set values.If the exception context does not match the set values, the test will fail.
-