alibaba / fastjson2

🚄 FASTJSON2 is a Java JSON library with excellent performance.
Apache License 2.0
3.79k stars 495 forks source link

Fix flaky tests in Issue#3049 #3095

Closed Mukta13 closed 1 month ago

Mukta13 commented 1 month ago

What this PR does / why we need it?

This is a fix for this flaky test issue:

https://github.com/alibaba/fastjson2/issues/3094

Summary of your change

There were 2 non deterministic tests that were changed using a simple fix. The code compares the deserialization of two JSON strings (jsonJackson and jsonFastjson2) into Map<String, Object> objects using the mapper.readValue() method. Once both JSON strings are converted into maps, the assertEquals() method is used to check if the two resulting maps are identical. This ensures that the JSON content from both sources is equivalent, regardless of the order.

Please indicate you've done the following:

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.

Mukta13 commented 1 month ago

I have signed the CLA agreement