Class ThrowableAsserter.ThrownError<T extends Throwable,R>
- java.lang.Object
-
- com.github.robtimus.junit.support.ThrowableAsserter.ThrownError<T,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 Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ThrowableAsserter<R>
thenAssert(Consumer<? super T> asserter)
Specifies the assertions that should be performed when an error is thrown.ThrowableAsserter<R>
thenAssertNothing()
Specifies that no assertions should be performed when an error is thrown.
-
-
-
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 isnull
.
-
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.
-
-