org.hamcrest.beans
Class SamePropertyValuesAs<T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.hamcrest.TypeSafeDiagnosingMatcher<T>
org.hamcrest.beans.SamePropertyValuesAs<T>
- All Implemented Interfaces:
- Matcher<T>, SelfDescribing
public class SamePropertyValuesAs<T>
- extends TypeSafeDiagnosingMatcher<T>
SamePropertyValuesAs
public SamePropertyValuesAs(T expectedBean)
matchesSafely
public boolean matchesSafely(T bean,
Description mismatch)
- Specified by:
matchesSafely in class TypeSafeDiagnosingMatcher<T>
describeTo
public void describeTo(Description description)
samePropertyValuesAs
public 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.
For example:
assertThat(myBean, samePropertyValuesAs(myExpectedBean))
- Parameters:
expectedBean - the bean against which examined beans are compared
Copyright © 2014. All rights reserved.