1

我对 Web 服务进行了一些回归测试,以确保在缺少必填字段时返回错误。当查询参数(例如http://dummyurl.com?someRequiredParameter=something)丢失时,一切正常。当缺少所需的路径参数时(例如http://dummyurl.com/requiredPathParameter/somethingelse),测试在 SoapUI 应用程序中正常工作,但在从 Maven 运行时失败。当它尝试查询这些错误的 URL 时,我在输出中看到错误,但是响应是否有不同(我是否应该从服务器检查 500),或者我需要设置其他一些断言,以便测试通过SoapUI 和 Maven?

编辑

完整的错误是:

16:07:38,672 ERROR [WsdlSubmit] Exception in request: org.apache.commons.httpclient.URIException: escaped absolute path not valid
16:07:38,672 ERROR [SoapUI] An error occured [escaped absolute path not valid], see error log for details
org.apache.commons.httpclient.URIException: escaped absolute path not valid
    at org.apache.commons.httpclient.URI.setRawPath(URI.java:2837)
    at org.apache.commons.httpclient.URI.parseUriReference(URI.java:2023)
    at org.apache.commons.httpclient.URI.<init>(URI.java:147)
    at org.apache.commons.httpclient.HttpMethodBase.getURI(HttpMethodBase.java:265)
    at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:383)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:194)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:76)
    at com.eviware.soapui.impl.rest.RestRequest.submit(RestRequest.java:208)
    at com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.run(RestTestRequestStep.java:753)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runTestStep(WsdlTestCaseRunner.java:207)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:138)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1146)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:679)
16:07:38,673 INFO  [SoapUIProTestCaseRunner] Assertion [Match content of [Fault]] has status UNKNOWN
4

2 回答 2

0

I ultimately had to disable the tests in question. It appears the SoapUI application can handle missing path parameters but the maven plugin can't.

If a new answer pops up that explains how to test for this using the SoapUI maven plugin, I'll give it a try and (hopefully) make it the accepted answer instead.

于 2013-06-11T18:31:46.470 回答
0

行为应该是相同的。

检查 SOAPUI Maven 插件生成的日志文件。它包含每个测试的返回码。如果服务器端出现错误,您应该找到 500 的错误。

您的测试用例已经包含一个检查返回码的断言?

于 2013-05-10T14:27:53.147 回答