Interface Call<R>
- All Known Implementing Classes:
NormalResult,ThrowableResult
public interface Call<R>
-
Method Summary
Modifier and TypeMethodDescriptiondefault RAsserts that the call resulted in a result of typetypeand returns the result.default RassertNormal(String message) Asserts that the call resulted in a result of typetypeand returns the result.assertNormal(Supplier<String> messageSupplier) Asserts that the call resulted in a result of typetypeand returns the result.default <E extends Throwable>
EassertThrows(Class<E> type) Asserts that the call resulted in n throwable of typetypeand returns the throwable.default <E extends Throwable>
EassertThrows(Class<E> type, String message) Asserts that the call resulted in a throwable of typetypeand returns the throwable.<E extends Throwable>
EassertThrows(Class<E> type, Supplier<String> messageSupplier) Asserts that the call resulted in a throwable of typetypeand returns the throwable.
-
Method Details
-
assertThrows
<E extends Throwable> E assertThrows(Class<E> type, Supplier<String> messageSupplier) throws org.opentest4j.AssertionFailedError Asserts that the call resulted in a throwable of typetypeand returns the throwable. Otherwise, anAssertionFailedErrorcontaining the message supplied bymessageSupplierwill be thrown.
messageSupplieris allowed to supplynull.- Type Parameters:
E- the type of the expected throwable- Parameters:
type- the type of the expected throwablemessageSupplier- a supplier for the message if the throwable was not thrown- Returns:
- the throwable resulted by the call
- Throws:
org.opentest4j.AssertionFailedError- if the call did not result in a throwable of typetype- See Also:
-
assertThrows
default <E extends Throwable> E assertThrows(Class<E> type, String message) throws org.opentest4j.AssertionFailedError Asserts that the call resulted in a throwable of typetypeand returns the throwable. Otherwise, anAssertionFailedErrorcontainingmessagewill be thrown.- Type Parameters:
E- the type of the expected throwable- Parameters:
type- the type of the expected throwablemessage- the message if the expected throwable was not thrown- Returns:
- the throwable resulted by the call
- Throws:
org.opentest4j.AssertionFailedError- if the call did not result in a throwable of typetype
-
assertThrows
default <E extends Throwable> E assertThrows(Class<E> type) throws org.opentest4j.AssertionFailedError Asserts that the call resulted in n throwable of typetypeand returns the throwable. Otherwise, anAssertionFailedErrorwill be thrown.- Type Parameters:
E- the type of the expected throwable- Parameters:
type- the type of the expected throwable- Returns:
- the throwable resulted by the call
- Throws:
org.opentest4j.AssertionFailedError- if the call did not result in a throwable of typetype
-
assertNormal
Asserts that the call resulted in a result of typetypeand returns the result. Otherwise, anAssertionFailedErrorcontaining the message supplied bymessageSupplierwill be thrown.
messageSupplieris allowed to supplynull.- Parameters:
messageSupplier- a supplier for the message if the throwable was not thrown- Returns:
- the result resulted by the call
- Throws:
org.opentest4j.AssertionFailedError- if the call resulted in a throwable
-
assertNormal
Asserts that the call resulted in a result of typetypeand returns the result. Otherwise, anAssertionFailedErrorcontainingmessagewill be thrown.- Parameters:
message- the message if the expected throwable was not thrown- Returns:
- the result resulted by the call
- Throws:
org.opentest4j.AssertionFailedError- if the call resulted in a throwable
-
assertNormal
Asserts that the call resulted in a result of typetypeand returns the result. Otherwise, anAssertionFailedErrorwill be thrown.- Returns:
- the result resulted by the call
- Throws:
org.opentest4j.AssertionFailedError- if the call resulted in a throwable
-