public class ThrowsException<T extends ThrowsException.Execution>
extends org.hamcrest.TypeSafeMatcher<T>
| Modifier and Type | Class and Description |
|---|---|
static interface |
ThrowsException.Execution |
| Modifier | Constructor and Description |
|---|---|
protected |
ThrowsException(Class<? extends Throwable> expectedExceptionType,
Pattern expectedExceptionMessagePattern) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
describeMismatchSafely(T item,
org.hamcrest.Description mismatchDescription) |
void |
describeTo(org.hamcrest.Description description) |
protected Throwable |
executeExecutionAndReturnException(ThrowsException.Execution execution) |
protected Optional<Pattern> |
expectedExceptionMessagePattern() |
protected Class<? extends Throwable> |
expectedExceptionType() |
protected boolean |
matchesSafely(T item) |
static <T extends ThrowsException.Execution> |
throwsException(Class<? extends Throwable> type) |
static <T extends ThrowsException.Execution> |
throwsException(Class<? extends Throwable> type,
Pattern messagePattern) |
static <T extends ThrowsException.Execution> |
throwsException(Class<? extends Throwable> type,
String messagePattern) |
static <T extends ThrowsException.Execution> |
throwsExceptionWithMessage(Class<? extends Throwable> type,
Pattern messagePattern) |
static <T extends ThrowsException.Execution> |
throwsExceptionWithMessage(Class<? extends Throwable> type,
String messagePattern) |
@Nonnull public static <T extends ThrowsException.Execution> org.hamcrest.Matcher<T> throwsException(@Nonnull Class<? extends Throwable> type, @Nullable Pattern messagePattern)
@Nonnull public static <T extends ThrowsException.Execution> org.hamcrest.Matcher<T> throwsException(@Nonnull Class<? extends Throwable> type, @Nullable String messagePattern)
@Nonnull public static <T extends ThrowsException.Execution> org.hamcrest.Matcher<T> throwsException(@Nonnull Class<? extends Throwable> type)
@Nonnull public static <T extends ThrowsException.Execution> org.hamcrest.Matcher<T> throwsExceptionWithMessage(@Nonnull Class<? extends Throwable> type, @Nullable Pattern messagePattern)
@Nonnull public static <T extends ThrowsException.Execution> org.hamcrest.Matcher<T> throwsExceptionWithMessage(@Nonnull Class<? extends Throwable> type, @Nullable String messagePattern)
protected boolean matchesSafely(@Nonnull T item)
matchesSafely in class org.hamcrest.TypeSafeMatcher<T extends ThrowsException.Execution>@Nonnull protected Throwable executeExecutionAndReturnException(@Nonnull ThrowsException.Execution execution)
public void describeTo(@Nonnull org.hamcrest.Description description)
protected void describeMismatchSafely(@Nonnull T item, @Nonnull org.hamcrest.Description mismatchDescription)
describeMismatchSafely in class org.hamcrest.TypeSafeMatcher<T extends ThrowsException.Execution>Copyright © 2017 echocat. All rights reserved.