assertk / assertk.assertions / hasCause

hasCause

(common, jvm) fun Assert<Throwable>.hasCause(cause: Throwable): Unit

Asserts the throwable is similar to the expected cause, checking the type and message.

See Also

hasNoCause