public class HamcrestCondition<T> extends Condition<T>
Condition<String> aStringContainingA = new HamcrestCondition<>(containsString("a"));
// assertions will pass
assertThat("abc").is(aStringContainingA);
assertThat("bc").isNot(aStringContainingA);
// assertion will fail
assertThat("bc").is(aStringContainingA);
Modifier and Type | Field and Description |
---|---|
private org.hamcrest.Matcher<T> |
matcher |
description
Constructor and Description |
---|
HamcrestCondition(org.hamcrest.Matcher<T> matcher)
Constructs a
Condition using the matcher given as a parameter. |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
describeMatcher() |
boolean |
matches(T value)
Verifies that the given value satisfies this condition.
|
as, as, describedAs, describedAs, description, toString