Package org.axonframework.test.matchers
Class EqualFieldsMatcher<T>
java.lang.Object
org.hamcrest.BaseMatcher<T>
org.axonframework.test.matchers.EqualFieldsMatcher<T>
- Type Parameters:
T- The type of object
- All Implemented Interfaces:
org.hamcrest.Matcher<T>,org.hamcrest.SelfDescribing
public class EqualFieldsMatcher<T>
extends org.hamcrest.BaseMatcher<T>
Matcher that will match an Object if all the fields on that Object contain values equal to the same field in the
expected instance.
- Since:
- 1.1
- Author:
- Allard Buijze
-
Constructor Summary
ConstructorsConstructorDescriptionEqualFieldsMatcher(T expected) Initializes an EqualFieldsMatcher that will match an object with equal properties as the givenexpectedobject.EqualFieldsMatcher(T expected, FieldFilter filter) Initializes an EqualFieldsMatcher that will match an object with equal properties as the givenexpectedobject. -
Method Summary
Modifier and TypeMethodDescriptionvoiddescribeTo(org.hamcrest.Description description) Returns the field that failed comparison, if any.Returns the actual value of a failed field comparison, if any.Returns the expected value of a failed field comparison, if any.booleanMethods inherited from class org.hamcrest.BaseMatcher
_dont_implement_Matcher___instead_extend_BaseMatcher_, describeMismatch, isNotNull, toString
-
Constructor Details
-
EqualFieldsMatcher
Initializes an EqualFieldsMatcher that will match an object with equal properties as the givenexpectedobject.- Parameters:
expected- The expected object
-
EqualFieldsMatcher
Initializes an EqualFieldsMatcher that will match an object with equal properties as the givenexpectedobject.- Parameters:
expected- The expected objectfilter- The filter describing the fields to include in the comparison
-
-
Method Details
-
matches
-
getFailedField
Returns the field that failed comparison, if any. This value is only populated aftermatches(Object)is called and a mismatch has been detected.- Returns:
- the field that failed comparison, if any
-
getFailedFieldExpectedValue
Returns the expected value of a failed field comparison, if any. This value is only populated aftermatches(Object)is called and a mismatch has been detected.- Returns:
- the expected value of the field that failed comparison, if any
-
getFailedFieldActualValue
Returns the actual value of a failed field comparison, if any. This value is only populated aftermatches(Object)is called and a mismatch has been detected.- Returns:
- the actual value of the field that failed comparison, if any
-
describeTo
public void describeTo(org.hamcrest.Description description)
-