T - Type of the throwablepublic class WillThrowMatcher<T extends Throwable> extends TypeSafeDiagnosingMatcher<Runnable>
| Modifier and Type | Method and Description |
|---|---|
boolean |
allMatchersMatch(Throwable throwable,
Description mismatchDescription) |
WillThrowMatcher<T> |
and(Matcher<T> throwableMather) |
void |
describeTo(Description description) |
protected boolean |
matchesSafely(Runnable runnable,
Description mismatchDescription) |
static <T extends Throwable> |
willThrow(Class<T> throwableClass)
Create a matcher for the throwable thrown by a runnable.
|
describeMismatch, matches_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toStringpublic static <T extends Throwable> WillThrowMatcher<T> willThrow(Class<T> throwableClass)
T - Type of the throwablethrowableClass - Throwable classprotected boolean matchesSafely(Runnable runnable, Description mismatchDescription)
matchesSafely in class TypeSafeDiagnosingMatcher<Runnable>public boolean allMatchersMatch(Throwable throwable, Description mismatchDescription)
public void describeTo(Description description)
public WillThrowMatcher<T> and(Matcher<T> throwableMather)
Copyright © 2022. All rights reserved.