如何使用soapUI返回http 500

Mar*_*kus 4 groovy soapui

我正在使用soapUI模拟我的Web服务.现在,我也想测试故障.为此,模拟服务(= soapUI)应返回HTTP 500.有谁知道,soapUI如何做到这一点?

谢谢

Mar*_*kus 7

这可以通过以下Groovy代码实现:

mockRequest.getHttpResponse().sendError(500)
Run Code Online (Sandbox Code Playgroud)


use*_*150 5

右键单击 MockResponse > Show MockResponse Editor Enter。查看左侧底部的 MockResponse Properties 向下滚动以搜索“Response HTTP-Status”,将值编辑为 500。