Matcher<T>
, SelfDescribing
public class SamePropertyValuesAs<T> extends TypeSafeDiagnosingMatcher<T>
Modifier and Type | Class | Description |
---|---|---|
static class |
SamePropertyValuesAs.PropertyMatcher |
Constructor | Description |
---|---|
SamePropertyValuesAs(T expectedBean) |
Modifier and Type | Method | Description |
---|---|---|
void |
describeTo(Description description) |
Generates a description of the object.
|
boolean |
matchesSafely(T bean,
Description mismatch) |
Subclasses should implement this.
|
static <T> Matcher<T> |
samePropertyValuesAs(T expectedBean) |
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.
|
_dont_implement_Matcher___instead_extend_BaseMatcher_, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
describeMismatch, matches
public SamePropertyValuesAs(T expectedBean)
public boolean matchesSafely(T bean, Description mismatch)
TypeSafeDiagnosingMatcher
matchesSafely
in class TypeSafeDiagnosingMatcher<T>
public void describeTo(Description description)
SelfDescribing
description
- The description to be built or appended to.public static <T> Matcher<T> samePropertyValuesAs(T expectedBean)
assertThat(myBean, samePropertyValuesAs(myExpectedBean))
expectedBean
- the bean against which examined beans are compared