3
如果断言在SoapUI
中失败,我想返回自定义错误消息。如果在SoapUI中断言失败,返回错误响应
我写了断言。即使断言失败,我总是会得到正确的回应。
我想下面的脚本:
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()
但在执行断言之前,这将返回。因此断言虽然会失败,但通过。
有没有一种方法可以实现这个目标?