Class DeepEqualsMatcher<T>

java.lang.Object
org.hamcrest.BaseMatcher<T>
org.axonframework.test.matchers.DeepEqualsMatcher<T>
Type Parameters:
T - The type of object to match.
All Implemented Interfaces:
org.hamcrest.Matcher<T>, org.hamcrest.SelfDescribing

public class DeepEqualsMatcher<T> extends org.hamcrest.BaseMatcher<T>
A BaseMatcher implementation that first matches based on Object.equals(Object). When this fails and equals() is not overridden from Object by T, the instance's field values are checked for equality. If this fails due to inaccessibility of the class or its fields, this matcher will not match.
Since:
4.5.10
Author:
Steven van Beelen
  • Constructor Details

    • DeepEqualsMatcher

      public DeepEqualsMatcher(T expected)
      Construct a DeepEqualsMatcher that will match an actual value with the given expected.
      Parameters:
      expected - The object to match with during matches(Object).
    • DeepEqualsMatcher

      public DeepEqualsMatcher(T expected, FieldFilter filter)
      Construct a DeepEqualsMatcher that will match an actual value with the given expected.
      Parameters:
      expected - The object to match with during matches(Object).
      filter - The filter describing the fields to include or exclude in the comparison.
  • Method Details

    • matches

      public boolean matches(Object actual)
    • describeTo

      public void describeTo(org.hamcrest.Description description)