assertThrows

public static T assertThrows<T extends Exception>(Class<T> expected, Callable callable, Context context, PreCommentSupplier<? super ResultOfExceptionalCall<T>> preCommentSupplier)(source)

Asserts that the given callable throws an exception of the given expected type.

Return

the result of the test

Parameters

expected

the expected type of the exception

context

the context of the test

preCommentSupplier

the supplier of the pre-comment