Forum Discussion
JHunt
7 years agoCommunity Hero
You could use this as a Script Assertion:
String unsorted = new groovy.json.JsonSlurper().parseText(messageExchange.responseContent)
."result" .with { groovy.json.JsonOutput.toJson( it ) } String sorted = new groovy.json.JsonSlurper().parseText(messageExchange.responseContent)
."result"
.sort { -it."rating" } .with { groovy.json.JsonOutput.toJson( it ) } assert sorted == unsorted
Related Content
- 4 years ago
Recent Discussions
- 15 years ago