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