Class ThrowableAsserter.ThrownError<T extends Throwable,​R>

  • Type Parameters:
    T - The error type.
    R - The result type of the code to execute.
    Enclosing class:
    ThrowableAsserter<R>

    public static final class ThrowableAsserter.ThrownError<T extends Throwable,​R>
    extends Object
    An object that can be used to configure the assertions that should be performed when an error is thrown.
    Author:
    Rob Spoor
    Since:
    2.0
    • Method Detail

      • thenAssert

        public ThrowableAsserter<R> thenAssert​(Consumer<? super T> asserter)
        Specifies the assertions that should be performed when an error is thrown.
        Parameters:
        asserter - An operation with the assertions that should be performed. The thrown error will be the operation's input.
        Returns:
        The error asserter that returned this object.
        Throws:
        NullPointerException - If the given operation is null.
      • thenAssertNothing

        public ThrowableAsserter<R> thenAssertNothing()
        Specifies that no assertions should be performed when an error is thrown.
        Returns:
        The error asserter that returned this object.