-
-
Notifications
You must be signed in to change notification settings - Fork 765
Labels
language: Java 17+An issue related to using AssertJ with Java 17 or newerAn issue related to using AssertJ with Java 17 or newertheme: recursive comparisonAn issue related to the recursive comparisonAn issue related to the recursive comparison
Milestone
Description
- assertj core version: 3.26.3
- java version: 21
- test framework version: junit-jupiter-api 5.9.3
Test case reproducing the bug
private record DummyRecord(String name, int revision) {
//This is the culprit, as the naming seems to affect assertJ's internal reflection-logic. Comparison works as expected when I rename this method to anything different.
public boolean isRevision() {
return revision != 1;
}
}
@Test public void recursiveComparison_javaRecords() {
assertThat(new DummyRecord("Bob", 10)).usingRecursiveComparison().isEqualTo(new DummyRecord("Bob", 2)); //passes, but should fail
}Metadata
Metadata
Assignees
Labels
language: Java 17+An issue related to using AssertJ with Java 17 or newerAn issue related to using AssertJ with Java 17 or newertheme: recursive comparisonAn issue related to the recursive comparisonAn issue related to the recursive comparison