public class SamePropertyValuesAs<T> extends DiagnosingMatcher<T>
| Constructor and Description |
|---|
SamePropertyValuesAs(T expectedBean,
java.util.List<java.lang.String> ignoredProperties) |
| Modifier and Type | Method and Description |
|---|---|
void |
describeTo(Description description)
Generates a description of the object.
|
protected boolean |
matches(java.lang.Object actual,
Description mismatch) |
static <B> Matcher<B> |
samePropertyValuesAs(B expectedBean,
java.lang.String... ignoredProperties)
Creates a matcher that matches when the examined object has values for all of
its JavaBean properties that are equal to the corresponding values of the
specified bean.
|
describeMismatch, matches_dont_implement_Matcher___instead_extend_BaseMatcher_, isNotNull, toStringpublic SamePropertyValuesAs(T expectedBean, java.util.List<java.lang.String> ignoredProperties)
protected boolean matches(java.lang.Object actual,
Description mismatch)
matches in class DiagnosingMatcher<T>public void describeTo(Description description)
SelfDescribingdescription - The description to be built or appended to.public static <B> Matcher<B> samePropertyValuesAs(B expectedBean, java.lang.String... ignoredProperties)
agerather than method names such as
getAge. For example:
assertThat(myBean, samePropertyValuesAs(myExpectedBean))
assertThat(myBean, samePropertyValuesAs(myExpectedBean), "age", "height")
expectedBean - the bean against which examined beans are comparedignoredProperties - do not check any of these named properties.