public class ExpectedToFailContext
extends Object
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).
| Constructor and description |
|---|
ExpectedToFailContext(Throwable thrown)Captures thrown together with its message and cause. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Throwable |
getCause()Returns the cause taken from the exception at construction. |
|
public Throwable |
getEx()Returns the exception this context was built from. |
|
public String |
getMessage()Returns the message taken from the exception at construction. |
Captures thrown together with its message and cause.
thrown - the exception the predicate will inspect Returns the cause taken from the exception at construction.
May be null.
Returns the exception this context was built from.
Returns the message taken from the exception at construction.
May be null.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.