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
Try to ignore multiple fields by calling .withIgnoredFields("fieldName") multiple times, instead of parsing in multiple arguments into a single call. The error message produced (java.lang.IllegalArgumentException: You can call either withOnlyTheseFields or withIgnoredFields, but not both.) does not apply to the issue (multiple calls to the withIgnoredFields function, which is not currently supported).
What is the code that triggers this problem?
public final class AnyClassUnderTest {
private Long firstFieldToBeIgnored;
private String secondFieldToBeIgnored;
private String thirdField;
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
final AnyClassUnderTest that = (AnyClassUnderTest) o;
return Objects.equals(thirdField, that.thirdField);
}
@Override
public int hashCode() {
return Objects.hash(thirdField);
}
}
public class AnyClassUnderTestTest {
@Test
public void equals() throws Exception {
EqualsVerifier.forClass(AnyClassUnderTest.class)
.withIgnoredFields("firstFieldToBeIgnored")
.withIgnoredFields("secondFieldToBeIgnored")
.verify();
}
}
What error message or stack trace does EqualsVerifier give?
java.lang.IllegalArgumentException: You can call either withOnlyTheseFields or withIgnoredFields, but not both.
at nl.jqno.equalsverifier.EqualsVerifier.checkIgnoredFields(EqualsVerifier.java:339)
at nl.jqno.equalsverifier.EqualsVerifier.withIgnoredFields(EqualsVerifier.java:178)
at nl.rabobank.gict.fpx.flf.query.service.model.db.AnyClassUnderTestTest.equals(AnyClassUnderTestTest.java:12)
The error message is incorrect.
What did you expect?
A correct error message, or that chaining simply works. :-)
Which version of EqualsVerifier are you using?
EqualsVerifier Version 2.3
Please provide any additional information below.
The text was updated successfully, but these errors were encountered:
What steps will reproduce the problem?
Try to ignore multiple fields by calling .withIgnoredFields("fieldName") multiple times, instead of parsing in multiple arguments into a single call. The error message produced (java.lang.IllegalArgumentException: You can call either withOnlyTheseFields or withIgnoredFields, but not both.) does not apply to the issue (multiple calls to the withIgnoredFields function, which is not currently supported).
What is the code that triggers this problem?
What error message or stack trace does EqualsVerifier give?
The error message is incorrect.
What did you expect?
A correct error message, or that chaining simply works. :-)
Which version of EqualsVerifier are you using?
EqualsVerifier Version 2.3
Please provide any additional information below.
The text was updated successfully, but these errors were encountered: