| Package | Description |
|---|---|
| net.obvj.junit.utils.matchers |
Provides matchers in general, for usage with
org.hamcrest.MatcherAssert. |
| Modifier and Type | Method and Description |
|---|---|
static ExceptionMatcher |
ExceptionMatcher.exception(Class<? extends Exception> exception)
This method behaves exactly the same as calling
throwsException(Class). |
static ExceptionMatcher |
AdvancedMatchers.exception(Class<? extends Exception> exception)
This method behaves exactly the same as calling
AdvancedMatchers.throwsException(Class). |
static ExceptionMatcher |
ExceptionMatcher.throwsException()
Creates a matcher that matches if the examined procedure throws any exception.
|
static ExceptionMatcher |
AdvancedMatchers.throwsException()
Creates a matcher that matches if the examined procedure throws any exception.
|
static ExceptionMatcher |
ExceptionMatcher.throwsException(Class<? extends Exception> exception)
Creates a matcher that matches if the examined procedure throws a given exception.
|
static ExceptionMatcher |
AdvancedMatchers.throwsException(Class<? extends Exception> exception)
Creates a matcher that matches if the examined procedure throws a given exception.
|
<T> ExceptionMatcher |
ExceptionMatcher.with(Function<? super T,Object> function,
org.hamcrest.Matcher<?> matcher)
Uses the given function to extract a value from the expected throwable, and a matcher to be
used against the function's result.
|
ExceptionMatcher |
ExceptionMatcher.withCause(Class<? extends Throwable> cause)
Assigns an expected cause for evaluation.
|
ExceptionMatcher |
ExceptionMatcher.withCause(ExceptionMatcher matcher)
Assigns another
ExceptionMatcher to be used for the exception cause validation. |
ExceptionMatcher |
ExceptionMatcher.withMessage(org.hamcrest.Matcher<String> matcher)
Assigns an external Matcher to be used in combination for the exception message
validation.
|
ExceptionMatcher |
ExceptionMatcher.withMessage(String message)
Assigns an expected message for validation.
|
ExceptionMatcher |
ExceptionMatcher.withMessageContaining(String... substrings)
Assigns one or more expected substrings for exception message validation.
|
ExceptionMatcher |
ExceptionMatcher.withNoCause()
Instruct the matcher to ensure that the expected exception has no cause.
|
| Modifier and Type | Method and Description |
|---|---|
ExceptionMatcher |
ExceptionMatcher.withCause(ExceptionMatcher matcher)
Assigns another
ExceptionMatcher to be used for the exception cause validation. |
Copyright © 2024. All rights reserved.