Fixed unstable test (issue with different behaviour depending on JDK and OS version).

- reorganised imports
- splitted assert of JSON into multiple asserts to avoid problems with the order of the attributes in the JSON string