Contributions
Re: SOAPUI 5.4.0 JSON Assertion of Double Values Ending .00
Thanks for your response. I have included an example of the JSON below, along with the script assertion. My requirement is to validate that there are 2 decimal places and it appears that the latest version (5.4.0) does not allow or support this any more; 5.3.0 worked just fine. import groovy.json.JsonSlurper def slurper = new JsonSlurper() def json = slurper.parseText '{"accountBalance":{"value":125755.00,"currency":"CAD","amountType":"DEBIT"}}' assert json.accountBalance.value.toString() == "125755.00" When running the above, I get the following error - assert json.accountBalance.value.toString() == "125755.00" | | | | | | | | 125755 false | | 125755 | [amountType:DEBIT, currency:CAD, value:125755] [accountBalance:[amountType:DEBIT, currency:CAD, value:125755]]2.8KViews0likes0CommentsSOAPUI 5.4.0 JSON Assertion of Double Values Ending .00
I have a script assertion which asserts double values for a JSON response. These asserts have been working until the latest release of SOAPUI (5.4.0). It would appear that JsonSlurper is truncating the value, removing .00 endings. Is this a known issue and is there a known workaround at this time? My assert looks something like below... def slurper = new JsonSlurper() def json = slurper.parseTextmessageExchange.response.responseContent assert json.accountBalance.value.toString() == "123.00"Solved2.9KViews0likes4Comments