Groovy / jsonSlurper在断言中使用OR(IN)

时间:2015-10-28 16:30:05

标签: groovy assertion jsonslurper

//verify if successful transaction

assert jsonSlurper.body.message == "Approved"

对于“已批准”和“Aprobada”,我希望这是真的,这不起作用:

assert jsonSlurper.body.message IN ("Approved","Aprobada")

由于

2 个答案:

答案 0 :(得分:3)

带有正确列表的小写in也应该起作用

assert jsonSlurper.body.message in ["Approved","Aprobada"]

答案 1 :(得分:1)

我实际上得到了它:

assert jsonSlurper.body.message == "Approved" || jsonSlurper.body.message == "Aprobada"