Forum Discussion
nmrao
7 years agoCommunity Hero
3rd Party services? So what, if there is defect or issue arises, it must be addressed. Not sure what is obstructing not to make a request.
JustinM89
7 years agoContributor
If you don't mind doing assertions through code, you could use JsonSlurper to take the response string and make it into an object like:
import groovy.json.JsonSlurper String responseStr = "" // wherever you get the response from def response = new JsonSlurper().parseText(responseStr)
// Perform assertions here (just making this stuff up)
assert response.employees[0].id == 12345
response.employees.each {
assert it.salary > 0
}
Provided you're not trying to assert on some crazy complex stuff, this could work.