Class ThrowableAsserter.NoError<R>

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

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

      • thenAssert

        public ThrowableAsserter<R> thenAssert​(Runnable asserter)
        Specifies the assertions that should be performed when no error is thrown.
        Parameters:
        asserter - A runnable with the assertions that should be performed.
        Returns:
        The error asserter that returned this object.
        Throws:
        NullPointerException - If the given runnable is null.
      • thenAssert

        public ThrowableAsserter<R> thenAssert​(Consumer<? super R> asserter)
        Specifies the assertions that should be performed when no error is thrown.
        Parameters:
        asserter - An operation with the assertions that should be performed. The result of the executed code 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 no error is thrown.
        Returns:
        The error asserter that returned this object.