T
- the type of the throwable being matchedpublic class ThrowableCauseMatcher<T extends java.lang.Throwable>
extends org.hamcrest.TypeSafeMatcher<T>
Modifier and Type | Field and Description |
---|---|
private org.hamcrest.Matcher<? extends java.lang.Throwable> |
causeMatcher |
Constructor and Description |
---|
ThrowableCauseMatcher(org.hamcrest.Matcher<? extends java.lang.Throwable> causeMatcher) |
Modifier and Type | Method and Description |
---|---|
protected void |
describeMismatchSafely(T item,
org.hamcrest.Description description) |
void |
describeTo(org.hamcrest.Description description) |
static <T extends java.lang.Throwable> |
hasCause(org.hamcrest.Matcher<? extends java.lang.Throwable> matcher)
Returns a matcher that verifies that the outer exception has a cause for which the supplied matcher
evaluates to true.
|
protected boolean |
matchesSafely(T item) |
private final org.hamcrest.Matcher<? extends java.lang.Throwable> causeMatcher
public ThrowableCauseMatcher(org.hamcrest.Matcher<? extends java.lang.Throwable> causeMatcher)
public void describeTo(org.hamcrest.Description description)
protected boolean matchesSafely(T item)
matchesSafely
in class org.hamcrest.TypeSafeMatcher<T extends java.lang.Throwable>
protected void describeMismatchSafely(T item, org.hamcrest.Description description)
describeMismatchSafely
in class org.hamcrest.TypeSafeMatcher<T extends java.lang.Throwable>
public static <T extends java.lang.Throwable> org.hamcrest.Matcher<T> hasCause(org.hamcrest.Matcher<? extends java.lang.Throwable> matcher)
T
- type of the outer exceptionmatcher
- to apply to the cause of the outer exception