You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A function that automatically ignores any fields that only the lhs has when comparing with recursiveComparision. Related to #2143, but for actual POJOs. This would basically mean, add an ignoringFields("every", "field", "lhs has", "but", "rhs has not").
Example
record A(Stringhello, intworld){}
record B(Stringhello, intplanet){}
record C( Stringhello) {}
vara = A("hello", 1);
assertThat(a).usingRecursiveComparison().ignoringFieldsOnlyLhsHas().isEqualTo(B("hello", 1)); // complain about a not having `planet`assertThat(a).usingRecursiveComparison().ignoringFieldsOnlyLhsHas().isEqualTo(C("hello")); // this is correct (`world` is ignored)assertThat(a).usingRecursiveComparison().ignoringFieldsOnlyLhsHas().isEqualTo(C("not hello")); // this fails because `"hello" != "not hello"`
The text was updated successfully, but these errors were encountered:
Feature summary
A function that automatically ignores any fields that only the lhs has when comparing with
recursiveComparision
. Related to #2143, but for actual POJOs. This would basically mean, add anignoringFields("every", "field", "lhs has", "but", "rhs has not")
.Example
The text was updated successfully, but these errors were encountered: