Write JSON unit tests in less code. Great for testing REST interfaces.
Summary
Write JSON tests as if you are comparing a string. Under the covers, JSONassert converts your string into a JSON object and compares the logical structure and data with the actual JSON. When strict is set to false (recommended), it forgives reordering data and extending results (as long as all the expected elements are there), making tests less brittle.
We tried to make error messages easy to understand. This is really important, since it gets hard for the eye to pick out the difference, particularly in long JSON strings. For example:
This implementation uses a clean-room implementation of the org.json
library implemented for the Android system, released under the Apache 2.0 license. See
com.vaadin.external.google:android-json
That jar does not include the org.json.JSONString interface, so a new implementation of that interface is added to this source.
请发表评论