'assertj recursive comparison ignoring regex failing after upgrade from 3.18.1 to 3.21.0
I have updated my springboot , along with that my assertj also seems to have upgraded. Now the test which was initially working in the older version is failing. assertThat(updated).usingRecursiveComparison().ignoringFieldsMatchingRegexes(ID_REGEXES).isEqualTo(expected);
ID_REGEXES: {"^id$", "^[\w.]+\.id$"};
I am trying to exclude all fields that Match on "id" exactly and any variable ending with ".id"
My object has nested children and it is failing on the id of the last child. This is working fine in 3.18.1 assert but not working in 3.21
this is the error:
field/property 'sites.SI1_F0K_HQ.ds.01-1234560.id' differ:
- actual value : 3L
- expected value: null
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|