This change introduces a helper method, assertMapsEqual(), that reduces test flakiness by serializing two objects to JSON, converting them into maps, and comparing their content. It ensures stable data comparison by avoiding issues with non-deterministic behavior or inconsistent serialization. Error handling is added to manage potential serialization failures.
What this PR does / why we need it?
The fix for: https://github.com/alibaba/fastjson2/issues/3096
Summary of your change
This change introduces a helper method, assertMapsEqual(), that reduces test flakiness by serializing two objects to JSON, converting them into maps, and comparing their content. It ensures stable data comparison by avoiding issues with non-deterministic behavior or inconsistent serialization. Error handling is added to manage potential serialization failures.
Can be tested by running:
Please indicate you've done the following: