java.lang.Object
org.junit.jupiter.api.AssertThrows
AssertThrows
is a collection of utility methods that support asserting
an exception of an expected type is thrown.- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static <T extends Throwable>
TassertThrows
(Class<T> expectedType, Executable executable) private static <T extends Throwable>
TassertThrows
(Class<T> expectedType, Executable executable, Object messageOrSupplier) (package private) static <T extends Throwable>
TassertThrows
(Class<T> expectedType, Executable executable, String message) (package private) static <T extends Throwable>
TassertThrows
(Class<T> expectedType, Executable executable, Supplier<String> messageSupplier)
-
Constructor Details
-
AssertThrows
private AssertThrows()
-
-
Method Details
-
assertThrows
-
assertThrows
static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, String message) -
assertThrows
static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, Supplier<String> messageSupplier) -
assertThrows
private static <T extends Throwable> T assertThrows(Class<T> expectedType, Executable executable, Object messageOrSupplier)
-