【发布时间】:2016-03-07 11:36:36
【问题描述】:
如果SoapUI 中的断言失败,我想返回自定义错误消息。
我已经写了断言。即使断言失败,我总是得到 OK 响应。
我尝试了以下脚本:
def assertionList = []
def idNotNull = (id!=null) ? "(id is not null" : assertionList.add("(id is null")
if(!assertionList.isEmpty())
{
return "exceptionResponse"
}
assert assertionList.isEmpty() : assertionList.toString()
但这会在 assert 执行之前返回。因此,断言虽然应该失败,但还是通过了。
有什么方法可以实现吗?
【问题讨论】:
标签: soap groovy soapui soap-client