Groovy / jsonSlurper 在断言中使用 OR (IN)
Groovy / jsonSlurper using OR (IN) in assertion
//verify if successful transaction
assert jsonSlurper.body.message == "Approved"
我希望这对 "Approved" 和 "Aprobada" 都为真,但这是行不通的:
assert jsonSlurper.body.message IN ("Approved","Aprobada")
谢谢
我真的明白了:
assert jsonSlurper.body.message == "Approved" || jsonSlurper.body.message == "Aprobada"
具有适当列表的小写 in
也应该有效
assert jsonSlurper.body.message in ["Approved","Aprobada"]
//verify if successful transaction
assert jsonSlurper.body.message == "Approved"
我希望这对 "Approved" 和 "Aprobada" 都为真,但这是行不通的:
assert jsonSlurper.body.message IN ("Approved","Aprobada")
谢谢
我真的明白了:
assert jsonSlurper.body.message == "Approved" || jsonSlurper.body.message == "Aprobada"
具有适当列表的小写 in
也应该有效
assert jsonSlurper.body.message in ["Approved","Aprobada"]