Package groovy.junit6.plugin
Class ExpectedToFailContext
java.lang.Object
groovy.junit6.plugin.ExpectedToFailContext
Delegate for closure predicates supplied to
ExpectedToFail, exposing
the thrown exception under three convenient names: ex (the
Throwable itself), message (its message), and cause
(its cause, possibly null).- Since:
- 6.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionExpectedToFailContext(Throwable thrown) Capturesthrowntogether with its message and cause. -
Method Summary
-
Constructor Details
-
ExpectedToFailContext
Capturesthrowntogether with its message and cause.- Parameters:
thrown- the exception the predicate will inspect
-
-
Method Details
-
getEx
Returns the exception this context was built from.- Returns:
- the captured exception
-
getMessage
Returns the message taken from the exception at construction. May benull.- Returns:
- the captured message
-
getCause
Returns the cause taken from the exception at construction. May benull.- Returns:
- the captured cause
-