We recently updated dependencies of a REST integration test which uses Groovy, HTTPBuilder, JSONAssert and Junit. When we went from HTTPBuilder 0.5.2 to 0.6 many of our tests failed.
We found that the format of the response changed due to a new "feature" in HTTPBuilder that provides "Automatic response parsing for registered content types".
Old, (0.5.2) format, expected response:
[
{
"name":"Portfolio_REST_Test01",
"description":"",
"referenceValueType":"Net Value",
"unitType":"SHARES",
"tags":[]
}
]
New (0.6.2) format of response:
[{tags=[], referenceValueType=Net Value, unitType=SHARES, description=, name=Portfolio_REST_Test01}]
The problem arises when JSONAssert attempts to parse a named value where the value is an empty string, see "Description" in the examples above. JSONAssert is expecting a character to follow the equals-sign, not a comma, and throws an exception when encountered.