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);
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 |
---|---|
boolean |
matches(T value)
Verifies that the given value satisfies this condition.
|
as, as, describedAs, describedAs, description, toString
Copyright © 2013–2018 AssertJ. All rights reserved.