Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
141 lines (119 sloc) 6.8 KB
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="c2700cd1-fc01-4817-9840-9a8db88674b9" activeEnvironment="Default" name="MongoDB Accounts" resourceRoot="" soapui-version="5.4.0" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings/><con:interface xsi:type="con:RestService" id="5f3bdf63-bd5d-4f43-9262-9f3031cec6c1" wadlVersion="http://wadl.dev.java.net/2009/02" name="http://localhost:9999" type="rest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache/><con:endpoints><con:endpoint>http://PL-VM171114123301:8080/</con:endpoint><con:endpoint>http://localhost:9999</con:endpoint><con:endpoint>http://localhost:9999/</con:endpoint></con:endpoints><con:resource name="Mock" path="/mongodb/mock" id="5c561281-3b7f-4ca0-afe1-e5b34c51406f"><con:settings/><con:parameters/><con:resource name="accounts" path="accounts" id="39610e5a-c37a-4683-82ac-3b6ac7ed10d1"><con:settings/><con:parameters/><con:resource name="{login}" path="{login}" id="18a23666-be03-42e9-9bdd-8eb28d63789d"><con:settings/><con:parameters><con:parameter><con:name>login</con:name><con:value>login</con:value><con:style>TEMPLATE</con:style><con:default>login</con:default></con:parameter></con:parameters><con:method name="Method 1" id="0a9e8a34-b82f-467e-a2c6-81b6d95a696b" method="GET"><con:settings/><con:parameters/><con:request name="Request 1" id="76678bda-db49-41bd-8493-da4091f3d624" mediaType="application/json"><con:settings/><con:endpoint>http://PL-VM171114123301:8080/</con:endpoint><con:request/><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:request></con:method></con:resource><con:method name="Method 1" id="d63d6ecc-5b1a-4c01-90bb-c55b13345232" method="GET"><con:settings/><con:parameters/><con:request name="Request 1" id="4083b139-9181-43e0-8fed-06e6308302ba" mediaType="application/json"><con:settings/><con:endpoint>http://PL-VM171114123301:8080/</con:endpoint><con:request/><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters/></con:request></con:method></con:resource></con:resource></con:interface><con:restMockService id="f0537a70-3958-48cf-bdd3-7db61b9c933b" port="9999" path="/" host="localhost" name="REST MockService 1" docroot=""><con:settings/><con:properties/><con:restMockAction name="/mongodb/mock/accounts" method="GET" resourcePath="/mongodb/mock/accounts" id="f3172ba0-a477-47aa-89d1-9ff52486959e"><con:settings/><con:defaultResponse xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/><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="Response 1" id="8e86670b-7b00-4adc-aaf4-4cb1fa18248d" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>[
{
"_id": "PBO",
"name": "Patryk",
"surname": "Abacki",
"role": "ADMIN",
"rank": 140
},
{
"_id": "ABO",
"name": "Adam",
"surname": "Abacki",
"role": "USER",
"rank": -5
},
{
"_id": "ZBO",
"name": "Zyta",
"surname": "Bbacka",
"role": "USER",
"rank": 44
},
{
"_id": "KBO",
"name": "Krystian",
"surname": "Bybacki",
"role": "USER",
"rank": 140
}
]</con:responseContent></con:response></con:restMockAction><con:restMockAction name="/mongodb/mock/accounts/login" method="GET" resourcePath="/mongodb/mock/accounts/login" id="8c019dec-dff1-4dc8-8034-36b84a3bcaa2"><con:settings/><con:defaultResponse>Response 1</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="Response 1" id="78de7ed4-7691-46b4-8867-6add23a3ab6c" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:responseContent>{
"_id": "PBO",
"name": "Patryk",
"surname": "Abacki",
"role": "ADMIN",
"rank": 140
}</con:responseContent></con:response></con:restMockAction></con:restMockService><con:properties/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/></con:soapui-project>