-
Notifications
You must be signed in to change notification settings - Fork 1
/
soapui-maven-example.xml
60 lines (49 loc) · 6.72 KB
/
soapui-maven-example.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="f9854840-1c49-470a-a73a-b7622c89551e" activeEnvironment="Default" name="REST Project 1" resourceRoot="" soapui-version="5.3.0" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:RestService" id="d8b161d0-eb0c-4c0c-a58f-19828b98b3bc" wadlVersion="http://wadl.dev.java.net/2009/02" name="http://localhost:8088" type="rest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart=""/><con:endpoints><con:endpoint>http://localhost:8088</con:endpoint></con:endpoints><con:resource name="" path="/hello" id="aaed924b-973e-419a-aaed-d5a29950db84"><con:settings/><con:parameters/><con:method name="1" id="c121581e-3a97-485a-a7ce-ad93d1800091" method="GET"><con:settings/><con:parameters/><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType xsi:nil="true"/><con:status>0</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="RESPONSE"><con:mediaType>application/json</con:mediaType><con:status>200</con:status><con:params/><con:element xmlns:loc="http://localhost/">loc:Response</con:element></con:representation><con:request name="Request 1" id="c86a255f-8392-4571-86b8-a7e7277e44ac" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8088/</con:endpoint><con:request/><con:originalUri>http://localhost/</con:originalUri><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/><con:parameterOrder/></con:request></con:method></con:resource></con:interface><con:testSuite id="72a8bcac-9f7e-4817-bb0f-bfd7d35d8329" name="hellosuite"><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase id="319747eb-e201-469c-93d2-19ab4f1e2d9f" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="hellocase" searchProperties="true"><con:settings/><con:testStep type="groovy" name="start mockservice" id="802c8021-144f-4f08-97f7-d61e07d3fcf3"><con:settings/><con:config><script>def project = testRunner.testCase.testSuite.project
project.restMockServices[0].start()</script></con:config></con:testStep><con:testStep type="restrequest" name="hello-request" id="7de3a00f-5656-4a88-b799-04b11664f18f"><con:settings/><con:config service="http://localhost:
" resourcePath="/hello" methodName="1" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="hello-request" id="c86a255f-8392-4571-86b8-a7e7277e44ac" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8088/</con:endpoint><con:request/><con:originalUri>http://localhost/</con:originalUri><con:assertion type="GroovyScriptAssertion" id="c9b4518c-f991-4239-8ea8-138dd79af242" name="Script Assertion"><con:configuration><scriptText>log.info "${messageExchange.response.responseContent}"
messageExchange.response.responseContent.contains('world')</scriptText></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/><con:parameterOrder/></con:restRequest></con:config></con:testStep><con:testStep type="groovy" name="stop mockservice" id="091786dd-5cdf-4103-b7d9-1976b144993c"><con:settings/><con:config><script>def project = testRunner.testCase.testSuite.project
project.restMockServices[0].mockRunner.stop()</script></con:config></con:testStep><con:properties/></con:testCase><con:properties/></con:testSuite><con:restMockService id="c5fc3123-e7fb-4b45-991c-579d8983b084" port="8088" path="/" host="KNA-5CG7205F44" name="restmock"><con:settings/><con:properties/><con:restMockAction name="hello" method="GET" resourcePath="/hello" id="81cf52b4-65dd-4a09-8e62-badf598826f4"><con:settings/><con:defaultResponse>world</con:defaultResponse><con:dispatchStyle>SEQUENCE</con:dispatchStyle><con:dispatchPath>/*
// Script dispatcher is used to select a response based on the incoming request.
// Here are few examples showing how to match based on path, query param, header and body
// Match based on path
def requestPath = mockRequest.getPath()
log.info "Path: "+ requestPath
if( requestPath.contains("json") )
{
// return the name of the response you want to dispatch
return "JSON Response"
}
// Match based on query parameter
def queryString = mockRequest.getRequest().getQueryString()
log.info "QueryString: " + queryString
if( queryString.contains("stockholm") )
{
// return the name of the response you want to dispatch
return "Response Stockholm"
}
else if( queryString.contains("london") )
{
// return the name of the response you want to dispatch
return "Response London"
}
// Match based on header
def acceptEncodingHeaderList = mockRequest.getRequestHeaders().get("Accept-Encoding")
log.info "AcceptEncoding Header List: " + acceptEncodingHeaderList
if( acceptEncodingHeaderList.contains("gzip,deflate") )
{
// return the name of the response you want to dispatch
return "GZiped Response"
}
// Match based on body
def requestBody = mockRequest.getRequestContent()
log.info "Request body: " + requestBody
if( requestBody.contains("some data") )
{
// return the name of the response you want to dispatch
return "Response N"
}
*/
</con:dispatchPath><con:response name="world" id="6fe8e3ec-32a0-4ef0-baf6-a271b6188b39" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>{
"hello": "world"
}</con:responseContent></con:response></con:restMockAction></con:restMockService><con:properties/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/></con:soapui-project>