assertj
assertj copied to clipboard
Recursive comparison does not work when comparing object to top level map
This was asked here https://stackoverflow.com/questions/67319902/assertj-usingrecursivecomparison-fails-when-top-level-value-is-a-map
Reproduced with:
static class Person
{
private final String name;
public Person(String name)
{
this.name = name;
}
}
@Test
void test()
{
assertThat(new Person("Foo")).usingRecursiveComparison()
.isEqualTo(Map.of("name", "Foo"));
}
Moved to 3.21 as it will require quite a bit of work
@joel-costigliola the SO question is no longer available. I think this is a new feature/improvement rather than a bug, right?
Moving it to 4.0.0