org.sonatype.sisu.litmus.testsupport.hamcrest
Class BeanMatchers
java.lang.Object
org.sonatype.sisu.litmus.testsupport.hamcrest.BeanMatchers
public class BeanMatchers
- extends Object
Java beans related matchers.
- Since:
- 1.0
Method Summary |
static
<T> org.hamcrest.Matcher<T> |
|
similarTo(T expected)
Are the two java beans similar?. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BeanMatchers
public BeanMatchers()
similarTo
public static <T> org.hamcrest.Matcher<T> similarTo(T expected)
- Are the two java beans similar?.
The matching is done by doing a deep equals of all getters present in actual and expected bean.
If bean contains array/collections/iterables/iterator getters it will apply similarity check on elements of those.
- Type Parameters:
T
- expected type- Parameters:
expected
- expected value to be matched
- Returns:
- true if beans are similar
Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.