Class NormalResult<R>
java.lang.Object
org.tudalgo.algoutils.tutor.general.call.NormalResult<R>
- Type Parameters:
R- the type of expected result
- All Implemented Interfaces:
Call<R>
An instance of
NormalResult represents a call that resulted in no exception.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassertNormal(Supplier<String> messageSupplier) Asserts that the call resulted in a result of typetypeand returns the result.<T extends Throwable>
TassertThrows(Class<T> type, Supplier<String> messageSupplier) Asserts that the call resulted in a throwable of typetypeand returns the throwable.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.tudalgo.algoutils.tutor.general.call.Call
assertNormal, assertNormal, assertThrows, assertThrows
-
Constructor Details
-
NormalResult
-
-
Method Details
-
assertThrows
public <T extends Throwable> T assertThrows(Class<T> type, Supplier<String> messageSupplier) throws org.opentest4j.AssertionFailedError Description copied from interface:CallAsserts that the call resulted in a throwable of typetypeand returns the throwable. Otherwise, anAssertionFailedErrorcontaining the message supplied bymessageSupplierwill be thrown.
messageSupplieris allowed to supplynull.- Specified by:
assertThrowsin interfaceCall<R>- Type Parameters:
T- 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:
-
assertNormal
Description copied from interface:CallAsserts that the call resulted in a result of typetypeand returns the result. Otherwise, anAssertionFailedErrorcontaining the message supplied bymessageSupplierwill be thrown.
messageSupplieris allowed to supplynull.- Specified by:
assertNormalin interfaceCall<R>- 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
-