Hello,
When comparing two maps, the recursive comparison doesn't seem to be taken into account for keys.
- assertj core version: 4.0.0-M1 (and earlier)
- java version: 21
I added two test cases in RecursiveComparisonAssert_for_maps_Test to reproduce the issue (should_pass_when_keys_are_equal and should_honor_ignored_fields_in_keys). Here is the first one :
@Test
void should_pass_when_keys_are_equal() {
// GIVEN
Person sheldon = new Person("Sheldon");
Person leonard = new Person("Leonard");
Person raj = new Person("Rajesh");
PersonDto sheldonDto = new PersonDto("Sheldon");
PersonDto leonardDto = new PersonDto("Leonard");
PersonDto rajDto = new PersonDto("Rajesh");
Map<Person, String> actual = mapOf(entry(sheldon, sheldon.name),
entry(leonard, leonard.name),
entry(raj, raj.name));
Map<PersonDto, String> expected = mapOf(entry(sheldonDto, sheldonDto.name),
entry(leonardDto, leonardDto.name),
entry(rajDto, rajDto.name));
// WHEN/THEN
then(actual).usingRecursiveComparison(recursiveComparisonConfiguration)
.isEqualTo(expected);
}
Could this issue be linked to #2165 ?
Hello,
When comparing two maps, the recursive comparison doesn't seem to be taken into account for keys.
I added two test cases in RecursiveComparisonAssert_for_maps_Test to reproduce the issue (should_pass_when_keys_are_equal and should_honor_ignored_fields_in_keys). Here is the first one :
Could this issue be linked to #2165 ?