T - Type of the scalar's valuepublic final class Throws<T>
extends org.hamcrest.TypeSafeDiagnosingMatcher<org.cactoos.Scalar<T>>
Here is an example how Throws can be used:
MatcherAssert.assertThat(
"The matcher check that [1,2,3] contains [2]",
() -> {
throw new IllegalArgumentException("No object(s) found.");
},
new Throws("No object(s) found.", IllegalArgumentException.class)
);| Constructor and Description |
|---|
Throws(Class<? extends Throwable> type)
Ctor.
|
Throws(org.hamcrest.Matcher<String> msg,
Class<? extends Throwable> type)
Ctor.
|
Throws(String msg,
Class<? extends Throwable> type)
Ctor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(org.hamcrest.Description dsc) |
protected boolean |
matchesSafely(org.cactoos.Scalar<T> obj,
org.hamcrest.Description dsc) |
Copyright © 2017–2019 jcabi.com. All rights reserved.