assertj icon indicating copy to clipboard operation
assertj copied to clipboard

Recursive comparison does not work when comparing object to top level map

Open joel-costigliola opened this issue 3 years ago • 3 comments

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"));
  }

joel-costigliola avatar Apr 30 '21 02:04 joel-costigliola

Moved to 3.21 as it will require quite a bit of work

joel-costigliola avatar May 05 '21 06:05 joel-costigliola

@joel-costigliola the SO question is no longer available. I think this is a new feature/improvement rather than a bug, right?

scordio avatar May 07 '22 00:05 scordio

Moving it to 4.0.0

joel-costigliola avatar May 07 '22 07:05 joel-costigliola