Class AssertThrowsDifferent
java.lang.Object
org.soliscode.test.assertions.AssertThrowsDifferent
A collection of utility methods that support asserting that an executable throws an exception that is not one of a
specified set of prohibited exception types.
- Since:
- 1.0
- Author:
- evanbergstrom
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertThrowsDifferent
(@NotNull Class<? extends Throwable> prohibitedType, @NotNull org.junit.jupiter.api.function.Executable executable) Asserts that the executable will throw an exception that is the prohibited exception type.static void
assertThrowsDifferent
(@NotNull Class<? extends Throwable> prohibitedType, @NotNull org.junit.jupiter.api.function.Executable executable, String message) Asserts that the executable will throw an exception that is the prohibited exception type.static void
assertThrowsDifferent
(@NotNull Class<? extends Throwable> prohibitedType, @NotNull org.junit.jupiter.api.function.Executable executable, Supplier<String> messageSupplier) Asserts that the executable will throw an exception that is the prohibited exception type.static void
assertThrowsDifferent
(@NotNull Collection<Class<? extends Throwable>> prohibitedTypes, @NotNull org.junit.jupiter.api.function.Executable executable) Asserts that the executable will throw an exception that is not one of a list of prohibited exception types.static void
assertThrowsDifferent
(@NotNull Collection<Class<? extends Throwable>> prohibitedTypes, @NotNull org.junit.jupiter.api.function.Executable executable, String message) Asserts that the executable will throw an exception that is not one of a list of prohibited exception types.static void
assertThrowsDifferent
(@NotNull Collection<Class<? extends Throwable>> prohibitedTypes, @NotNull org.junit.jupiter.api.function.Executable executable, Supplier<String> messageSupplier) Asserts that the executable will throw an exception that is not one of a list of prohibited exception types.
-
Method Details
-
assertThrowsDifferent
public static void assertThrowsDifferent(@NotNull @NotNull Collection<Class<? extends Throwable>> prohibitedTypes, @NotNull @NotNull org.junit.jupiter.api.function.Executable executable) Asserts that the executable will throw an exception that is not one of a list of prohibited exception types.- Parameters:
prohibitedTypes
- the exception types that should not be thrown.executable
- the executable to test.
-
assertThrowsDifferent
public static void assertThrowsDifferent(@NotNull @NotNull Class<? extends Throwable> prohibitedType, @NotNull @NotNull org.junit.jupiter.api.function.Executable executable) Asserts that the executable will throw an exception that is the prohibited exception type.- Parameters:
prohibitedType
- the exception type that should not be thrown.executable
- the executable to test.
-
assertThrowsDifferent
public static void assertThrowsDifferent(@NotNull @NotNull Collection<Class<? extends Throwable>> prohibitedTypes, @NotNull @NotNull org.junit.jupiter.api.function.Executable executable, String message) Asserts that the executable will throw an exception that is not one of a list of prohibited exception types.- Parameters:
prohibitedTypes
- the exception types that the executable should throw.executable
- the executable to test.message
- the message to include in the exception if the assertions fails.
-
assertThrowsDifferent
public static void assertThrowsDifferent(@NotNull @NotNull Class<? extends Throwable> prohibitedType, @NotNull @NotNull org.junit.jupiter.api.function.Executable executable, String message) Asserts that the executable will throw an exception that is the prohibited exception type.- Parameters:
prohibitedType
- the exception type that should not be thrown.executable
- the executable to test.message
- the message to include in the exception if the assertions fails.
-
assertThrowsDifferent
public static void assertThrowsDifferent(@NotNull @NotNull Collection<Class<? extends Throwable>> prohibitedTypes, @NotNull @NotNull org.junit.jupiter.api.function.Executable executable, Supplier<String> messageSupplier) Asserts that the executable will throw an exception that is not one of a list of prohibited exception types.- Parameters:
prohibitedTypes
- the exception types that should not be thrown.executable
- the executable to test.messageSupplier
- the supplier of the message to include in the exception if the assertions fails.
-
assertThrowsDifferent
public static void assertThrowsDifferent(@NotNull @NotNull Class<? extends Throwable> prohibitedType, @NotNull @NotNull org.junit.jupiter.api.function.Executable executable, Supplier<String> messageSupplier) Asserts that the executable will throw an exception that is the prohibited exception type.- Parameters:
prohibitedType
- the exception type that should not be thrown.executable
- the executable to test.messageSupplier
- the supplier of the message to include in the exception if the assertions fails.
-