-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZycus-Assignment-soapui-project.xml
155 lines (139 loc) · 24.1 KB
/
Zycus-Assignment-soapui-project.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<?xml version="1.0" encoding="UTF-8"?>
<con:soapui-project id="682c6b14-9a3a-45d8-8613-d66f31b072a9" activeEnvironment="Default" name="Zycus Assignment" soapui-version="5.4.0" abortOnError="false" runType="SEQUENTIAL" xmlns:con="http://eviware.com/soapui/config"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.actions.iface.tools.soapui.TestRunnerAction@values-local"><![CDATA[<xml-fragment xmlns:con="http://eviware.com/soapui/config">
<con:entry key="Report Format(s)" value=""/>
<con:entry key="Host:Port" value=""/>
<con:entry key="Export JUnit Results" value="true"/>
<con:entry key="Export All" value="false"/>
<con:entry key="Save After" value="false"/>
<con:entry key="Add Settings" value="false"/>
<con:entry key="WSS Password Type" value=""/>
<con:entry key="TestSuite" value="assignment TestSuite"/>
<con:entry key="Endpoint" value=""/>
<con:entry key="Select Report Type" value=""/>
<con:entry key="System Properties" value=""/>
<con:entry key="Password" value=""/>
<con:entry key="Print Report" value="true"/>
<con:entry key="Open Report" value="false"/>
<con:entry key="Export JUnit Results with test properties" value="false"/>
<con:entry key="Global Properties" value=""/>
<con:entry key="Project Properties" value=""/>
<con:entry key="Project Password" value=""/>
<con:entry key="TestCase" value="<all>"/>
<con:entry key="Username" value=""/>
<con:entry key="user-settings.xml Password" value=""/>
<con:entry key="TestRunner Path" value=""/>
<con:entry key="Environment" value="Default"/>
<con:entry key="Coverage Report" value="false"/>
<con:entry key="Enable UI" value="false"/>
<con:entry key="Root Folder" value="/Users/kisna/Documents/soapui_workspace"/>
<con:entry key="Ignore Errors" value="false"/>
<con:entry key="Domain" value=""/>
<con:entry key="Tool Args" value=""/>
<con:entry key="Save Project" value="false"/>
</xml-fragment>]]></con:setting></con:settings><con:interface xsi:type="con:RestService" id="dbeeb5b4-96f7-4e89-af0c-459cc86ca53c" wadlVersion="http://wadl.dev.java.net/2009/02" name="http://localhost:8080" type="rest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:settings/><con:definitionCache type="TEXT" rootPart=""/><con:endpoints><con:endpoint>http://Krishnas-MacBook-Pro.local:8089/</con:endpoint><con:endpoint>http://localhost:8080</con:endpoint></con:endpoints><con:resource name="assignment" path="/assignment" id="ba5443c8-a2fa-4826-98f1-ceb06d759fde"><con:settings/><con:parameters/><con:resource name="/customers/{id}" path="/customers/{id}" id="d11399f6-6912-4049-8641-6a8252eaeb7a"><con:settings/><con:parameters><con:parameter required="true"><con:name>id</con:name><con:value>id</con:value><con:style>TEMPLATE</con:style><con:default>id</con:default></con:parameter></con:parameters><con:method name="GET" id="5204c301-2a91-4d8e-8eef-2b1f63a5be64" 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>text/html; charset=iso-8859-1</con:mediaType><con:status>200</con:status><con:params/><con:element>html</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</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:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>404</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType>application/json</con:mediaType><con:status>404</con:status><con:params/></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:request name="customers_GET" id="5d027915-af15-4d13-b90b-ef5fad42fb64" 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:8080</con:endpoint><con:request/><con:originalUri>http://localhost/assignment/customers/id</con:originalUri><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="id" value="1" xmlns="http://eviware.com/soapui/config"/></con:parameters></con:request></con:method></con:resource><con:resource name="/customers" path="customers" id="5efdff08-2446-4d69-b0e2-f9ff688d047e"><con:settings/><con:parameters/><con:method name="POST" id="2904f46c-b754-40ee-8a8e-6e60b449f06e" method="POST"><con:settings/><con:parameters/><con:representation type="REQUEST"><con:mediaType>application/json</con:mediaType><con:params/></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:representation><con:representation type="FAULT"><con:mediaType>application/json</con:mediaType><con:status>500</con:status><con:params/></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:representation type="FAULT"><con:mediaType xsi:nil="true"/><con:status>500</con:status><con:params/><con:element>data</con:element></con:representation><con:request name="customers_POST" id="62018ce7-b3a2-4d81-9bb0-4be6bfe81b02" mediaType="application/json" postQueryString="false"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8080</con:endpoint><con:request>{
first_name: "",
last_name: "",
address_line1: "",
address_line2: "",
zip_code: "",
state: "",
country: "",
phone_num: ""
}
</con:request><con:originalUri>http://localhost/assignment/customers</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:resource></con:interface><con:testSuite id="b6a6778b-6a91-4903-8f2d-3a9f072175f8" name="assignment TestSuite"><con:description>TestSuite generated for REST Service [http://localhost:8080]</con:description><con:settings/><con:runType>SEQUENTIAL</con:runType><con:testCase id="f3a5cff6-fe7e-4931-86e9-b48c3a8d6172" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Get Customer - Success" searchProperties="true"><con:description>TestCase generated for REST Resource [/customers/{id}] located at [/assignment/customers/{id}]</con:description><con:settings/><con:testStep type="restrequest" name="customers_GET" id="1edf2572-93b3-4880-acdf-4cd087c7c9c1"><con:settings/><con:config service="http://localhost:8080" resourcePath="/assignment/customers/{id}" methodName="GET" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="customers_GET" id="5d027915-af15-4d13-b90b-ef5fad42fb64" 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:8080</con:endpoint><con:request/><con:originalUri>http://localhost/assignment/customers/1</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="7d255f8c-1910-4621-8a25-6423d4904535" name="Valid HTTP Status Codes"><con:configuration><codes>200</codes></con:configuration></con:assertion><con:assertion type="GroovyScriptAssertion" id="22318f11-8d72-4ed1-8b39-ba81f3b7716a" name="Script Assertion"><con:configuration/></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="id" value="1" xmlns="http://eviware.com/soapui/config"/></con:parameters></con:restRequest></con:config></con:testStep><con:properties/></con:testCase><con:testCase id="3d14f871-2140-4892-9f63-5e5993fd2cf0" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Get Customer - NotFound" searchProperties="true"><con:settings/><con:testStep type="restrequest" name="customers_GET NotFound" id="37a5b58f-5fa1-42f1-b3df-9c4b6603e404"><con:settings/><con:config service="http://localhost:8080" methodName="GET" resourcePath="/assignment/customers/{id}" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="customers_GET NotFound" id="caf66bdc-04d8-469a-bab7-4e424a61890b" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080</con:endpoint><con:request/><con:originalUri>http://Krishnas-MacBook-Pro.local/assignment/customers/9</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="66ea0685-d14a-45f5-9fe9-0f402d4f6e75" name="Valid HTTP Status Codes"><con:configuration><codes>404</codes></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="id" value="9" xmlns="http://eviware.com/soapui/config"/></con:parameters></con:restRequest></con:config></con:testStep><con:properties/></con:testCase><con:testCase id="0beaff61-a0df-476e-a3bf-fc1642bbb27b" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Get Customer - InvalidInput" searchProperties="true"><con:settings/><con:testStep type="restrequest" name="customers_GET InvalidInput" id="38b9ac20-766c-4cb4-a123-80035744ac3a"><con:settings/><con:config service="http://localhost:8080" methodName="GET" resourcePath="/assignment/customers/{id}" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="customers_GET InvalidInput" id="caf66bdc-04d8-469a-bab7-4e424a61890b" mediaType="application/json"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:encoding>UTF-8</con:encoding><con:endpoint>http://localhost:8080</con:endpoint><con:request/><con:originalUri>http://Krishnas-MacBook-Pro.local/assignment/customers/9</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="66ea0685-d14a-45f5-9fe9-0f402d4f6e75" name="Valid HTTP Status Codes"><con:configuration><codes>400</codes></con:configuration></con:assertion><con:assertion type="Simple NotContains" id="e09ec8fe-20d6-40cd-8c3b-bee4836f621d" name="Not Contains"><con:configuration><token>id</token><ignoreCase>false</ignoreCase><useRegEx>false</useRegEx></con:configuration></con:assertion><con:credentials><con:authType>No Authorization</con:authType></con:credentials><con:jmsConfig JMSDeliveryMode="PERSISTENT"/><con:jmsPropertyConfig/><con:parameters><entry key="id" value="A" xmlns="http://eviware.com/soapui/config"/></con:parameters></con:restRequest></con:config></con:testStep><con:properties/></con:testCase><con:testCase id="690125e4-8092-4573-8680-751f4d463032" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Create Customer - Success" searchProperties="true"><con:description>TestCase generated for REST Resource [/customers] located at [/assignment/customers]</con:description><con:settings/><con:testStep type="restrequest" name="customers_POST" id="025f2069-9889-44a0-b09f-bb442dd33b38"><con:settings/><con:config service="http://localhost:8080" resourcePath="/assignment/customers" methodName="POST" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="customers_POST" id="62018ce7-b3a2-4d81-9bb0-4be6bfe81b02" mediaType="application/json" postQueryString="false"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8080</con:endpoint><con:request> "firstName": "Krishna",
"lastName": "Krishna",
"addressline1": "address line 1",
"addressline2": "address line 2",
"zip": 00700,
"state": "karnataka",
"country": "india",
"phone": 1000000000
}
</con:request><con:originalUri>http://localhost/assignment/customers</con:originalUri><con:assertion type="Simple NotContains" id="93bfd5fe-fed0-4503-aa23-501cd663fe9d" name="Not Contains"><con:configuration><token>*</token><ignoreCase>false</ignoreCase><useRegEx>true</useRegEx></con:configuration></con:assertion><con:assertion type="Valid HTTP Status Codes" id="8b269bf4-7004-45c5-8e9d-aff5a143cdc0" name="Valid HTTP Status Codes"><con:configuration><codes>201</codes></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:properties/></con:testCase><con:testCase id="c850032b-fc76-4027-b66e-2299eb2f8f85" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Create Customer - Duplicate" searchProperties="true"><con:description>TestCase generated for REST Resource [/customers] located at [/assignment/customers]</con:description><con:settings/><con:testStep type="restrequest" name="customers_POST" id="78184c89-56f7-45a1-965a-72e0dde7e907"><con:settings/><con:config service="http://localhost:8080" resourcePath="/assignment/customers" methodName="POST" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="customers_POST" id="62018ce7-b3a2-4d81-9bb0-4be6bfe81b02" mediaType="application/json" postQueryString="false"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8080</con:endpoint><con:request> {
"firstName": "Krishna",
"lastName": "Krishna",
"addressline1": "address line 1",
"addressline2": "address line 2",
"zip": 00700,
"state": "karnataka",
"country": "india",
"phone": 1000000000
}
</con:request><con:originalUri>http://localhost/assignment/customers</con:originalUri><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:properties/></con:testCase><con:testCase id="c365c28b-92f3-414c-a23e-0d61c87b0f7e" failOnError="true" failTestCaseOnErrors="true" keepSession="false" maxResults="0" name="Create Customer - InternalServerError" searchProperties="true"><con:description>TestCase generated for REST Resource [/customers] located at [/assignment/customers]</con:description><con:settings/><con:testStep type="restrequest" name="customers_POST" id="ed7e8e3b-aef3-4c80-8807-af019214bd33"><con:settings/><con:config service="http://localhost:8080" resourcePath="/assignment/customers" methodName="POST" xsi:type="con:RestRequestStep" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><con:restRequest name="customers_POST" id="62018ce7-b3a2-4d81-9bb0-4be6bfe81b02" mediaType="application/json" postQueryString="false"><con:settings><con:setting id="com.eviware.soapui.impl.wsdl.WsdlRequest@request-headers"><xml-fragment/></con:setting></con:settings><con:endpoint>http://localhost:8080</con:endpoint><con:request> {
"firstName": "Krishna",
"lastName": "Krishna",
"addressline1": "address line 1",
"addressline2": "address line 2",
"zip": 00700,
"state": "karnataka",
"country": "india",
"phone": 1000000000
}
</con:request><con:originalUri>http://localhost/assignment/customers</con:originalUri><con:assertion type="Valid HTTP Status Codes" id="f5136e06-883f-4f02-b83c-f6aa13f6e2e0" name="Valid HTTP Status Codes"><con:configuration><codes>500</codes></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:properties/></con:testCase><con:properties/></con:testSuite><con:restMockService id="7b678544-2eb3-416b-b585-a05f7cef2dc1" port="8080" path="/" host="Krishnas-MacBook-Pro.local" name="Customers MockService 1" docroot=""><con:settings/><con:startScript>context["rows"] = []
File testData = new File("/Users/kisna/Documents/soapui_workspace/zycus_workspace/customers.csv")
testData.eachLine { content, lineNumber ->
context["rows"] << content
log.info content
}</con:startScript><con:properties/><con:onRequestScript/><con:restMockAction name="/assignment/customers/id" method="GET" resourcePath="/assignment/customers/" id="ea6c4ff1-a55b-446c-9697-0c224bef3f00"><con:settings/><con:defaultResponse>Return Customer</con:defaultResponse><con:dispatchStyle>SCRIPT</con:dispatchStyle><con:dispatchPath>def id = mockRequest.getPath().split("/")[-1]
if ( context["rows"].size <= id ) {
return "Return Customer"
} else if ( context["rows"].size > id ) {
return "Return Customer NotFound"
} else {
return "Return Customer - InvalidInput"
}</con:dispatchPath><con:response name="Return Customer" id="fd8dc254-7acd-454a-a651-80803b85fcd3" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:script>
def idValue = mockRequest.getPath().split("/")[-1].toInteger()
File testData = new File("/Users/kisna/Documents/soapui_workspace/zycus_workspace/customers.csv")
testData.eachLine { content, lineNumber ->
context["rows"] << content
}
def rowItems = context["rows"][idValue - 1].split(/,/)
requestContext["id"] = rowItems[0]
requestContext["firstName"] = rowItems[1]
requestContext["lastName"] = rowItems[2]
requestContext["addressline1"] = rowItems[3]
requestContext["addressline2"] = rowItems[4]
requestContext["zip"] = rowItems[5]
requestContext["state"] = rowItems[6]
requestContext["country"] = rowItems[7]
requestContext["phone"] = rowItems[8]
</con:script><con:responseContent>{
"id" : ${id},
"First Name": ${firstName},
"Last Name": ${lastName},
"Address Line1": ${addressline1},
"Address Line2": ${addressline2},
"ZIP": ${zip},
"State": ${state},
"Country": ${country},
"Phone": ${phone}
}
</con:responseContent></con:response><con:response name="Return Customer NotFound" id="b5ac6fb3-515d-4f12-9d6b-05b2da8efa47" httpResponseStatus="404" mediaType="application/json"><con:settings/><con:responseContent>Customer NotFound</con:responseContent></con:response><con:response name="Return Customer InvalidInput" id="6d23540f-c933-4509-8204-78c7bd11b3d3" httpResponseStatus="400" mediaType="application/json"><con:settings/><con:responseContent>Not Supported Request</con:responseContent></con:response></con:restMockAction><con:restMockAction name="/assignment/customers" method="POST" resourcePath="/assignment/customers" id="b40ecc3a-a7a7-415c-9b07-a13dc874da4b"><con:settings/><con:defaultResponse>Create Customer - Success</con:defaultResponse><con:dispatchStyle>SCRIPT</con:dispatchStyle><con:dispatchPath>import groovy.json.JsonSlurper
def slurper = new JsonSlurper()
def request = slurper.parseText(mockRequest.requestContent)
if( (request?.firstName!=null) && (request?.addressline1!=null) ) {
return "Create Customer - Success"
} else {
return "Create Customer - Server Error"
}
</con:dispatchPath><con:response name="Create Customer - Success" id="6172ec00-8b20-4e34-95ab-7ea76cef0e96" httpResponseStatus="200" mediaType="application/json"><con:settings/><con:script>import groovy.json.JsonSlurper
def slurper = new JsonSlurper()
def request = slurper.parseText(mockRequest.requestContent)
def customer=[]
def rowIndext
File testData = new File("/Users/kisna/Documents/soapui_workspace/zycus_workspace/customers.csv")
testData.eachLine { content, lineNumber ->
rowIndext = lineNumber
}
context["rowIndex"] = context["rows"].size
customer[0] = rowIndext + 1
customer[1] = request?.firstName
customer[2] = request?.lastName
customer[3] = request?.addressline1
customer[4] = request?.addressline2
customer[5] = request?.zip
customer[6] = request?.state
customer[7] = request?.country
customer[8] = request?.phone
testData.append("\n"+ customer.toString().replace("[","").replace("]",""))
</con:script><con:responseContent/></con:response><con:response name="Create Customer - Existing User" id="2b20c230-e867-4b6f-97af-27304af92df6" httpResponseStatus="200"><con:settings/><con:responseContent/></con:response><con:response name="Create Customer - Server Error" id="73f75908-2ed1-4b91-94f5-644c868a2a10" httpResponseStatus="500" mediaType="application/json"><con:settings/><con:responseContent>Something Went Wrong!!</con:responseContent></con:response></con:restMockAction></con:restMockService><con:properties/><con:wssContainer/><con:oAuth2ProfileContainer/><con:oAuth1ProfileContainer/><con:sensitiveInformation/></con:soapui-project>