質問

I have some regression tests for a web service to make sure we return errors when required fields are missing. When query parameters (e.g. http://dummyurl.com?someRequiredParameter=something) are missing, everything works fine. When required path parameters are missing (e.g. http://dummyurl.com/requiredPathParameter/somethingelse), the test works correctly in the SoapUI application, but fails when run from Maven. I see errors in the output when it tries to query these bad URLs, but is there something different about the response (should I be checking for 500's from the server), or some other assertation I need to set up so the tests pass in both SoapUI and Maven?

EDIT

The full error is:

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
役に立ちましたか?

解決 2

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.

他のヒント

The behaviour should be the same.

Check the log file generated by the SOAPUI Maven plugin. It contains for each test the return code. If there is an error on the server side, you should find 500's.

Your test case already contains an assertion checking the return code ?

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top