hjhjhjnew 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +28 -0
- data/README.md +55 -0
- data/lib/tester.rb +56 -0
- data/lib/tester/api_helper.rb +261 -0
- data/lib/tester/configuration.rb +66 -0
- data/lib/tester/controllers/base_controller.rb +59 -0
- data/lib/tester/controllers/body_params_controller.rb +1270 -0
- data/lib/tester/controllers/echo_controller.rb +134 -0
- data/lib/tester/controllers/error_codes_controller.rb +179 -0
- data/lib/tester/controllers/form_params_controller.rb +1391 -0
- data/lib/tester/controllers/header_controller.rb +63 -0
- data/lib/tester/controllers/query_param_controller.rb +779 -0
- data/lib/tester/controllers/response_types_controller.rb +717 -0
- data/lib/tester/controllers/template_params_controller.rb +93 -0
- data/lib/tester/exceptions/api_exception.rb +18 -0
- data/lib/tester/exceptions/global_test_exception.rb +32 -0
- data/lib/tester/exceptions/local_test_exception.rb +30 -0
- data/lib/tester/exceptions/nested_model_exception.rb +37 -0
- data/lib/tester/http/faraday_client.rb +55 -0
- data/lib/tester/http/http_call_back.rb +22 -0
- data/lib/tester/http/http_client.rb +92 -0
- data/lib/tester/http/http_context.rb +18 -0
- data/lib/tester/http/http_method_enum.rb +11 -0
- data/lib/tester/http/http_request.rb +48 -0
- data/lib/tester/http/http_response.rb +21 -0
- data/lib/tester/models/additional_model_parameters.rb +70 -0
- data/lib/tester/models/base_model.rb +52 -0
- data/lib/tester/models/boss.rb +129 -0
- data/lib/tester/models/days.rb +30 -0
- data/lib/tester/models/delete_body.rb +52 -0
- data/lib/tester/models/echo_response.rb +88 -0
- data/lib/tester/models/employee.rb +155 -0
- data/lib/tester/models/job.rb +43 -0
- data/lib/tester/models/person.rb +113 -0
- data/lib/tester/models/query_parameter.rb +43 -0
- data/lib/tester/models/server_response.rb +61 -0
- data/lib/tester/models/suite_code.rb +21 -0
- data/lib/tester/models/test_nstring_encoding.rb +52 -0
- data/lib/tester/models/test_r_nstring_encoding.rb +52 -0
- data/lib/tester/models/test_rstring_encoding.rb +52 -0
- data/lib/tester/models/validate.rb +61 -0
- data/lib/tester/tester_client.rb +61 -0
- data/test/controllers/controller_test_base.rb +33 -0
- data/test/controllers/test_body_params_controller.rb +1210 -0
- data/test/controllers/test_echo_controller.rb +29 -0
- data/test/controllers/test_error_codes_controller.rb +47 -0
- data/test/controllers/test_form_params_controller.rb +1099 -0
- data/test/controllers/test_header_controller.rb +30 -0
- data/test/controllers/test_query_param_controller.rb +345 -0
- data/test/controllers/test_response_types_controller.rb +429 -0
- data/test/controllers/test_template_params_controller.rb +47 -0
- data/test/http_response_catcher.rb +16 -0
- data/test/test_helper.rb +91 -0
- metadata +178 -0
@@ -0,0 +1,30 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class HeaderControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.header
|
9
|
+
end
|
10
|
+
|
11
|
+
# Todo: Add description for test test_send_headers
|
12
|
+
def test_send_headers()
|
13
|
+
# Parameters for the API call
|
14
|
+
custom_header = 'TestString'
|
15
|
+
value = 'TestString'
|
16
|
+
|
17
|
+
# Perform the API call through the SDK function
|
18
|
+
result = self.class.controller.send_headers(custom_header, value)
|
19
|
+
|
20
|
+
# Test response code
|
21
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
22
|
+
|
23
|
+
# Test whether the captured response is as we expected
|
24
|
+
assert_not_nil(result)
|
25
|
+
expected_body = JSON.parse('{"passed":true}')
|
26
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
27
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
@@ -0,0 +1,345 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class QueryParamControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.query_param
|
9
|
+
end
|
10
|
+
|
11
|
+
# Todo: Add description for test test_date_array
|
12
|
+
def test_date_array()
|
13
|
+
# Parameters for the API call
|
14
|
+
dates = JSON.parse('["1994-02-13","1994-02-13"]').map { |element| Date.iso8601(element) }
|
15
|
+
|
16
|
+
# Perform the API call through the SDK function
|
17
|
+
result = self.class.controller.date_array(dates)
|
18
|
+
|
19
|
+
# Test response code
|
20
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
21
|
+
|
22
|
+
# Test whether the captured response is as we expected
|
23
|
+
assert_not_nil(result)
|
24
|
+
expected_body = JSON.parse('{"passed":true}')
|
25
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
26
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
27
|
+
end
|
28
|
+
|
29
|
+
# Todo: Add description for test test_optional_dynamic_query_param
|
30
|
+
def test_optional_dynamic_query_param()
|
31
|
+
# Parameters for the API call
|
32
|
+
name = 'farhan'
|
33
|
+
|
34
|
+
# dictionary for optional query parameters
|
35
|
+
optional_query_parameters = {}
|
36
|
+
optional_query_parameters['field'] = 'QA'
|
37
|
+
|
38
|
+
# Perform the API call through the SDK function
|
39
|
+
result = self.class.controller.optional_dynamic_query_param(name, optional_query_parameters)
|
40
|
+
|
41
|
+
# Test response code
|
42
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
43
|
+
|
44
|
+
# Test whether the captured response is as we expected
|
45
|
+
assert_not_nil(result)
|
46
|
+
expected_body = JSON.parse('{"passed":true}')
|
47
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
48
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
49
|
+
end
|
50
|
+
|
51
|
+
# Todo: Add description for test test_date
|
52
|
+
def test_date()
|
53
|
+
# Parameters for the API call
|
54
|
+
date = Date.parse('1994-02-13')
|
55
|
+
|
56
|
+
# Perform the API call through the SDK function
|
57
|
+
result = self.class.controller.date(date)
|
58
|
+
|
59
|
+
# Test response code
|
60
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
61
|
+
|
62
|
+
# Test whether the captured response is as we expected
|
63
|
+
assert_not_nil(result)
|
64
|
+
expected_body = JSON.parse('{"passed":true}')
|
65
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
66
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
67
|
+
end
|
68
|
+
|
69
|
+
# Todo: Add description for test test_unix_date_time_array
|
70
|
+
def test_unix_date_time_array()
|
71
|
+
# Parameters for the API call
|
72
|
+
datetimes = JSON.parse('[1484719381,1484719381]').map { |element| Time.at(element).utc.to_datetime }
|
73
|
+
|
74
|
+
# Perform the API call through the SDK function
|
75
|
+
result = self.class.controller.unix_date_time_array(datetimes)
|
76
|
+
|
77
|
+
# Test response code
|
78
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
79
|
+
|
80
|
+
# Test whether the captured response is as we expected
|
81
|
+
assert_not_nil(result)
|
82
|
+
expected_body = JSON.parse('{"passed":true}')
|
83
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
84
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
85
|
+
end
|
86
|
+
|
87
|
+
# Todo: Add description for test test_unix_date_time
|
88
|
+
def test_unix_date_time()
|
89
|
+
# Parameters for the API call
|
90
|
+
datetime = Time.at(1484719381).utc.to_datetime
|
91
|
+
|
92
|
+
# Perform the API call through the SDK function
|
93
|
+
result = self.class.controller.unix_date_time(datetime)
|
94
|
+
|
95
|
+
# Test response code
|
96
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
97
|
+
|
98
|
+
# Test whether the captured response is as we expected
|
99
|
+
assert_not_nil(result)
|
100
|
+
expected_body = JSON.parse('{"passed":true}')
|
101
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
102
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
103
|
+
end
|
104
|
+
|
105
|
+
# Todo: Add description for test test_rfc_1123_date_time
|
106
|
+
def test_rfc_1123_date_time()
|
107
|
+
# Parameters for the API call
|
108
|
+
datetime = DateTime.httpdate('Sun, 06 Nov 1994 08:49:37 GMT')
|
109
|
+
|
110
|
+
# Perform the API call through the SDK function
|
111
|
+
result = self.class.controller.rfc_1123_date_time(datetime)
|
112
|
+
|
113
|
+
# Test response code
|
114
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
115
|
+
|
116
|
+
# Test whether the captured response is as we expected
|
117
|
+
assert_not_nil(result)
|
118
|
+
expected_body = JSON.parse('{"passed":true}')
|
119
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
120
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
121
|
+
end
|
122
|
+
|
123
|
+
# Todo: Add description for test test_rfc_1123_date_time_array
|
124
|
+
def test_rfc_1123_date_time_array()
|
125
|
+
# Parameters for the API call
|
126
|
+
datetimes = JSON.parse('["Sun, 06 Nov 1994 08:49:37 GMT","Sun, 06 Nov 1994 08:49:37 GMT"]').map { |element| DateTime.httpdate(element) }
|
127
|
+
|
128
|
+
# Perform the API call through the SDK function
|
129
|
+
result = self.class.controller.rfc_1123_date_time_array(datetimes)
|
130
|
+
|
131
|
+
# Test response code
|
132
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
133
|
+
|
134
|
+
# Test whether the captured response is as we expected
|
135
|
+
assert_not_nil(result)
|
136
|
+
expected_body = JSON.parse('{"passed":true}')
|
137
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
138
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
139
|
+
end
|
140
|
+
|
141
|
+
# Todo: Add description for test test_rfc_3339_date_time_array
|
142
|
+
def test_rfc_3339_date_time_array()
|
143
|
+
# Parameters for the API call
|
144
|
+
datetimes = JSON.parse('["1994-02-13T14:01:54.9571247Z","1994-02-13T14:01:54.9571247Z"]').map { |element| DateTime.rfc3339(element) }
|
145
|
+
|
146
|
+
# Perform the API call through the SDK function
|
147
|
+
result = self.class.controller.rfc_3339_date_time_array(datetimes)
|
148
|
+
|
149
|
+
# Test response code
|
150
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
151
|
+
|
152
|
+
# Test whether the captured response is as we expected
|
153
|
+
assert_not_nil(result)
|
154
|
+
expected_body = JSON.parse('{"passed":true}')
|
155
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
156
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
157
|
+
end
|
158
|
+
|
159
|
+
# Todo: Add description for test test_rfc_3339_date_time
|
160
|
+
def test_rfc_3339_date_time()
|
161
|
+
# Parameters for the API call
|
162
|
+
datetime = DateTime.rfc3339('1994-02-13T14:01:54.9571247Z')
|
163
|
+
|
164
|
+
# Perform the API call through the SDK function
|
165
|
+
result = self.class.controller.rfc_3339_date_time(datetime)
|
166
|
+
|
167
|
+
# Test response code
|
168
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
169
|
+
|
170
|
+
# Test whether the captured response is as we expected
|
171
|
+
assert_not_nil(result)
|
172
|
+
expected_body = JSON.parse('{"passed":true}')
|
173
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
174
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
175
|
+
end
|
176
|
+
|
177
|
+
# Todo: Add description for test test_no_params
|
178
|
+
def test_no_params()
|
179
|
+
|
180
|
+
# Perform the API call through the SDK function
|
181
|
+
result = self.class.controller.no_params()
|
182
|
+
|
183
|
+
# Test response code
|
184
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
185
|
+
|
186
|
+
# Test whether the captured response is as we expected
|
187
|
+
assert_not_nil(result)
|
188
|
+
expected_body = JSON.parse('{"passed":true}')
|
189
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
190
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
191
|
+
end
|
192
|
+
|
193
|
+
# Todo: Add description for test test_string_param
|
194
|
+
def test_string_param()
|
195
|
+
# Parameters for the API call
|
196
|
+
string = 'l;asd;asdwe[2304&&;\'.d??\\a\\\\\\;sd//'
|
197
|
+
|
198
|
+
# Perform the API call through the SDK function
|
199
|
+
result = self.class.controller.string_param(string)
|
200
|
+
|
201
|
+
# Test response code
|
202
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
203
|
+
|
204
|
+
# Test whether the captured response is as we expected
|
205
|
+
assert_not_nil(result)
|
206
|
+
expected_body = JSON.parse('{"passed":true}')
|
207
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
208
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
209
|
+
end
|
210
|
+
|
211
|
+
# Todo: Add description for test test_url_param
|
212
|
+
def test_url_param()
|
213
|
+
# Parameters for the API call
|
214
|
+
url = 'https://www.shahidisawesome.com/and/also/a/narcissist?thisis=aparameter&another=one'
|
215
|
+
|
216
|
+
# Perform the API call through the SDK function
|
217
|
+
result = self.class.controller.url_param(url)
|
218
|
+
|
219
|
+
# Test response code
|
220
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
221
|
+
|
222
|
+
# Test whether the captured response is as we expected
|
223
|
+
assert_not_nil(result)
|
224
|
+
expected_body = JSON.parse('{"passed":true}')
|
225
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
226
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
227
|
+
end
|
228
|
+
|
229
|
+
# Todo: Add description for test test_number_array
|
230
|
+
def test_number_array()
|
231
|
+
# Parameters for the API call
|
232
|
+
integers = JSON.parse('[1,2,3,4,5]')
|
233
|
+
|
234
|
+
# Perform the API call through the SDK function
|
235
|
+
result = self.class.controller.number_array(integers)
|
236
|
+
|
237
|
+
# Test response code
|
238
|
+
assert([*200..208].include? @response_catcher.response.status_code)
|
239
|
+
|
240
|
+
# Test whether the captured response is as we expected
|
241
|
+
assert_not_nil(result)
|
242
|
+
expected_body = JSON.parse('{"passed":true}')
|
243
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
244
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
245
|
+
end
|
246
|
+
|
247
|
+
# Todo: Add description for test test_string_array
|
248
|
+
def test_string_array()
|
249
|
+
# Parameters for the API call
|
250
|
+
strings = JSON.parse('["abc","def"]')
|
251
|
+
|
252
|
+
# Perform the API call through the SDK function
|
253
|
+
result = self.class.controller.string_array(strings)
|
254
|
+
|
255
|
+
# Test response code
|
256
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
257
|
+
|
258
|
+
# Test whether the captured response is as we expected
|
259
|
+
assert_not_nil(result)
|
260
|
+
expected_body = JSON.parse('{"passed":true}')
|
261
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
262
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
263
|
+
end
|
264
|
+
|
265
|
+
# Todo: Add description for test test_simple_query
|
266
|
+
def test_simple_query()
|
267
|
+
# Parameters for the API call
|
268
|
+
boolean = true
|
269
|
+
number = 4
|
270
|
+
string = 'TestString'
|
271
|
+
|
272
|
+
# dictionary for optional query parameters
|
273
|
+
optional_query_parameters = {}
|
274
|
+
|
275
|
+
# Perform the API call through the SDK function
|
276
|
+
result = self.class.controller.simple_query(boolean, number, string, optional_query_parameters)
|
277
|
+
|
278
|
+
# Test response code
|
279
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
280
|
+
|
281
|
+
# Test whether the captured response is as we expected
|
282
|
+
assert_not_nil(result)
|
283
|
+
expected_body = JSON.parse('{"passed":true}')
|
284
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
285
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
286
|
+
end
|
287
|
+
|
288
|
+
# Todo: Add description for test test_string_enum_array
|
289
|
+
def test_string_enum_array()
|
290
|
+
# Parameters for the API call
|
291
|
+
days = JSON.parse('["Tuesday","Saturday","Wednesday","Monday","Sunday"]')
|
292
|
+
|
293
|
+
# Perform the API call through the SDK function
|
294
|
+
result = self.class.controller.string_enum_array(days)
|
295
|
+
|
296
|
+
# Test response code
|
297
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
298
|
+
|
299
|
+
# Test whether the captured response is as we expected
|
300
|
+
assert_not_nil(result)
|
301
|
+
expected_body = JSON.parse('{"passed":true}')
|
302
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
303
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
304
|
+
end
|
305
|
+
|
306
|
+
# Todo: Add description for test test_multiple_params
|
307
|
+
def test_multiple_params()
|
308
|
+
# Parameters for the API call
|
309
|
+
number = 123412312
|
310
|
+
precision = 1112.34
|
311
|
+
string = '""test./;";12&&3asl"";"qw1&34"///..//.'
|
312
|
+
url = 'http://www.abc.com/test?a=b&c="http://lolol.com?param=no&another=lol"'
|
313
|
+
|
314
|
+
# Perform the API call through the SDK function
|
315
|
+
result = self.class.controller.multiple_params(number, precision, string, url)
|
316
|
+
|
317
|
+
# Test response code
|
318
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
319
|
+
|
320
|
+
# Test whether the captured response is as we expected
|
321
|
+
assert_not_nil(result)
|
322
|
+
expected_body = JSON.parse('{"passed":true}')
|
323
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
324
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
325
|
+
end
|
326
|
+
|
327
|
+
# Todo: Add description for test test_integer_enum_array
|
328
|
+
def test_integer_enum_array()
|
329
|
+
# Parameters for the API call
|
330
|
+
suites = JSON.parse('[1,3,4,2,3]')
|
331
|
+
|
332
|
+
# Perform the API call through the SDK function
|
333
|
+
result = self.class.controller.integer_enum_array(suites)
|
334
|
+
|
335
|
+
# Test response code
|
336
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
337
|
+
|
338
|
+
# Test whether the captured response is as we expected
|
339
|
+
assert_not_nil(result)
|
340
|
+
expected_body = JSON.parse('{"passed":true}')
|
341
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
342
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
343
|
+
end
|
344
|
+
|
345
|
+
end
|
@@ -0,0 +1,429 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require_relative 'controller_test_base'
|
4
|
+
|
5
|
+
class ResponseTypesControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.response_types
|
9
|
+
end
|
10
|
+
|
11
|
+
# Todo: Add description for test test_get_date_array
|
12
|
+
def test_get_date_array()
|
13
|
+
|
14
|
+
# Perform the API call through the SDK function
|
15
|
+
result = self.class.controller.get_date_array()
|
16
|
+
|
17
|
+
# Test response code
|
18
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
19
|
+
|
20
|
+
# Test whether the captured response is as we expected
|
21
|
+
assert_not_nil(result)
|
22
|
+
expected_body = JSON.parse('["1994-02-13","1994-02-13"]')
|
23
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
24
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
25
|
+
end
|
26
|
+
|
27
|
+
# Todo: Add description for test test_get_date
|
28
|
+
def test_get_date()
|
29
|
+
|
30
|
+
# Perform the API call through the SDK function
|
31
|
+
result = self.class.controller.get_date()
|
32
|
+
|
33
|
+
# Test response code
|
34
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
35
|
+
|
36
|
+
# Test whether the captured response is as we expected
|
37
|
+
assert_not_nil(result)
|
38
|
+
assert_equal('1994-02-13', @response_catcher.response.raw_body)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Todo: Add description for test test_get_long
|
42
|
+
def test_get_long()
|
43
|
+
|
44
|
+
# Perform the API call through the SDK function
|
45
|
+
result = self.class.controller.get_long()
|
46
|
+
|
47
|
+
# Test response code
|
48
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
49
|
+
|
50
|
+
# Test whether the captured response is as we expected
|
51
|
+
assert_not_nil(result)
|
52
|
+
assert_equal('5147483647', @response_catcher.response.raw_body)
|
53
|
+
end
|
54
|
+
|
55
|
+
# Todo: Add description for test test_get_model
|
56
|
+
def test_get_model()
|
57
|
+
|
58
|
+
# Perform the API call through the SDK function
|
59
|
+
result = self.class.controller.get_model()
|
60
|
+
|
61
|
+
# Test response code
|
62
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
63
|
+
|
64
|
+
# Test whether the captured response is as we expected
|
65
|
+
assert_not_nil(result)
|
66
|
+
expected_body = JSON.parse(
|
67
|
+
'{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid":'\
|
68
|
+
'"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"'\
|
69
|
+
',"salary":20000,"department":"Software Development","joiningDay":"Saturday"'\
|
70
|
+
',"workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","n'\
|
71
|
+
'ame":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"123'\
|
72
|
+
'321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","sa'\
|
73
|
+
'lary":20000,"department":"Software Development","joiningDay":"Saturday","wo'\
|
74
|
+
'rkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wife'\
|
75
|
+
'","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"1'\
|
76
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid"'\
|
77
|
+
',"age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"19'\
|
78
|
+
'94-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 N'\
|
79
|
+
'ov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futur'\
|
80
|
+
'e Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthd'\
|
81
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futur'\
|
82
|
+
'e Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthda'\
|
83
|
+
'y":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun'\
|
84
|
+
', 06 Nov 1994 08:49:37 GMT"}'
|
85
|
+
)
|
86
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
87
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
88
|
+
end
|
89
|
+
|
90
|
+
# Todo: Add description for test test_get_string_enum_array
|
91
|
+
def test_get_string_enum_array()
|
92
|
+
|
93
|
+
# Perform the API call through the SDK function
|
94
|
+
result = self.class.controller.get_string_enum_array()
|
95
|
+
|
96
|
+
# Test response code
|
97
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
98
|
+
|
99
|
+
# Test whether the captured response is as we expected
|
100
|
+
assert_not_nil(result)
|
101
|
+
expected_body = JSON.parse('["Tuesday","Saturday","Wednesday","Monday","Sunday"]')
|
102
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
103
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
104
|
+
end
|
105
|
+
|
106
|
+
# Todo: Add description for test test_get_string_enum
|
107
|
+
def test_get_string_enum()
|
108
|
+
|
109
|
+
# Perform the API call through the SDK function
|
110
|
+
result = self.class.controller.get_string_enum()
|
111
|
+
|
112
|
+
# Test response code
|
113
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
114
|
+
|
115
|
+
# Test whether the captured response is as we expected
|
116
|
+
assert_not_nil(result)
|
117
|
+
assert_equal('Monday', @response_catcher.response.raw_body)
|
118
|
+
end
|
119
|
+
|
120
|
+
# Todo: Add description for test test_get_model_array
|
121
|
+
def test_get_model_array()
|
122
|
+
|
123
|
+
# Perform the API call through the SDK function
|
124
|
+
result = self.class.controller.get_model_array()
|
125
|
+
|
126
|
+
# Test response code
|
127
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
128
|
+
|
129
|
+
# Test whether the captured response is as we expected
|
130
|
+
assert_not_nil(result)
|
131
|
+
expected_body = JSON.parse(
|
132
|
+
'[{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid"'\
|
133
|
+
':"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z'\
|
134
|
+
'","salary":20000,"department":"Software Development","joiningDay":"Saturday'\
|
135
|
+
'","workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","'\
|
136
|
+
'name":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"12'\
|
137
|
+
'3321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","s'\
|
138
|
+
'alary":20000,"department":"Software Development","joiningDay":"Saturday","w'\
|
139
|
+
'orkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wif'\
|
140
|
+
'e","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"'\
|
141
|
+
'1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid'\
|
142
|
+
'","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"1'\
|
143
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 '\
|
144
|
+
'Nov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futu'\
|
145
|
+
're Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birth'\
|
146
|
+
'day":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futu'\
|
147
|
+
're Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthd'\
|
148
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Su'\
|
149
|
+
'n, 06 Nov 1994 08:49:37 GMT"},{"name":"Shahid Khaliq","age":5147483645,"add'\
|
150
|
+
'ress":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":'\
|
151
|
+
'"1994-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Develo'\
|
152
|
+
'pment","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],'\
|
153
|
+
'"boss":{"personType":"Boss","name":"Zeeshan Ejaz","age":5147483645,"address'\
|
154
|
+
'":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":"199'\
|
155
|
+
'4-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Developmen'\
|
156
|
+
't","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],"dep'\
|
157
|
+
'endents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, S # 20'\
|
158
|
+
'","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9'\
|
159
|
+
'571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S # 20"'\
|
160
|
+
',"uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.95'\
|
161
|
+
'71247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT","promotedAt":1484719381'\
|
162
|
+
'},"dependents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, '\
|
163
|
+
'S # 20","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:0'\
|
164
|
+
'1:54.9571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S'\
|
165
|
+
' # 20","uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01'\
|
166
|
+
':54.9571247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT"}]'
|
167
|
+
)
|
168
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
169
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
170
|
+
end
|
171
|
+
|
172
|
+
# Todo: Add description for test test_get_int_enum
|
173
|
+
def test_get_int_enum()
|
174
|
+
|
175
|
+
# Perform the API call through the SDK function
|
176
|
+
result = self.class.controller.get_int_enum()
|
177
|
+
|
178
|
+
# Test response code
|
179
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
180
|
+
|
181
|
+
# Test whether the captured response is as we expected
|
182
|
+
assert_not_nil(result)
|
183
|
+
assert_equal('3', @response_catcher.response.raw_body)
|
184
|
+
end
|
185
|
+
|
186
|
+
# Todo: Add description for test test_get_int_enum_array
|
187
|
+
def test_get_int_enum_array()
|
188
|
+
|
189
|
+
# Perform the API call through the SDK function
|
190
|
+
result = self.class.controller.get_int_enum_array()
|
191
|
+
|
192
|
+
# Test response code
|
193
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
194
|
+
|
195
|
+
# Test whether the captured response is as we expected
|
196
|
+
assert_not_nil(result)
|
197
|
+
expected_body = JSON.parse('[1,3,4,2,3]')
|
198
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
199
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
200
|
+
end
|
201
|
+
|
202
|
+
# Todo: Add description for test test_get_precision
|
203
|
+
def test_get_precision()
|
204
|
+
|
205
|
+
# Perform the API call through the SDK function
|
206
|
+
result = self.class.controller.get_precision()
|
207
|
+
|
208
|
+
# Test response code
|
209
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
210
|
+
|
211
|
+
# Test whether the captured response is as we expected
|
212
|
+
assert_not_nil(result)
|
213
|
+
assert_equal('4.999', @response_catcher.response.raw_body)
|
214
|
+
end
|
215
|
+
|
216
|
+
# Todo: Add description for test test_get_binary
|
217
|
+
def test_get_binary()
|
218
|
+
|
219
|
+
# Perform the API call through the SDK function
|
220
|
+
result = self.class.controller.get_binary()
|
221
|
+
|
222
|
+
# Test response code
|
223
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
224
|
+
|
225
|
+
# Test whether the captured response is as we expected
|
226
|
+
assert_not_nil(result)
|
227
|
+
assert_equal(File.binread(TestHelper.get_file('http://localhost:3000/response/image')), @response_catcher.response.raw_body)
|
228
|
+
end
|
229
|
+
|
230
|
+
# Todo: Add description for test test_get_integer
|
231
|
+
def test_get_integer()
|
232
|
+
|
233
|
+
# Perform the API call through the SDK function
|
234
|
+
result = self.class.controller.get_integer()
|
235
|
+
|
236
|
+
# Test response code
|
237
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
238
|
+
|
239
|
+
# Test whether the captured response is as we expected
|
240
|
+
assert_not_nil(result)
|
241
|
+
assert_equal('4', @response_catcher.response.raw_body)
|
242
|
+
end
|
243
|
+
|
244
|
+
# Todo: Add description for test test_get_integer_array
|
245
|
+
def test_get_integer_array()
|
246
|
+
|
247
|
+
# Perform the API call through the SDK function
|
248
|
+
result = self.class.controller.get_integer_array()
|
249
|
+
|
250
|
+
# Test response code
|
251
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
252
|
+
|
253
|
+
# Test whether the captured response is as we expected
|
254
|
+
assert_not_nil(result)
|
255
|
+
expected_body = JSON.parse('[1,2,3,4,5]')
|
256
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
257
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
258
|
+
end
|
259
|
+
|
260
|
+
# Todo: Add description for test test_get_dynamic
|
261
|
+
def test_get_dynamic()
|
262
|
+
|
263
|
+
# Perform the API call through the SDK function
|
264
|
+
result = self.class.controller.get_dynamic()
|
265
|
+
|
266
|
+
# Test response code
|
267
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
268
|
+
|
269
|
+
# Test whether the captured response is as we expected
|
270
|
+
assert_not_nil(result)
|
271
|
+
expected_body = JSON.parse('{"method":"GET","body":{},"uploadCount":0}')
|
272
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
273
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
274
|
+
end
|
275
|
+
|
276
|
+
# Todo: Add description for test test_get_dynamic_array
|
277
|
+
def test_get_dynamic_array()
|
278
|
+
|
279
|
+
# Perform the API call through the SDK function
|
280
|
+
result = self.class.controller.get_dynamic_array()
|
281
|
+
|
282
|
+
# Test response code
|
283
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
284
|
+
|
285
|
+
# Test whether the captured response is as we expected
|
286
|
+
assert_not_nil(result)
|
287
|
+
expected_body = JSON.parse('{"method":"GET","body":{},"uploadCount":0}')
|
288
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
289
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
290
|
+
end
|
291
|
+
|
292
|
+
# Todo: Add description for test test_get_3339_datetime
|
293
|
+
def test_get_3339_datetime()
|
294
|
+
|
295
|
+
# Perform the API call through the SDK function
|
296
|
+
result = self.class.controller.get_3339_datetime()
|
297
|
+
|
298
|
+
# Test response code
|
299
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
300
|
+
|
301
|
+
# Test whether the captured response is as we expected
|
302
|
+
assert_not_nil(result)
|
303
|
+
assert_equal('2016-03-13T12:52:32.123Z', @response_catcher.response.raw_body)
|
304
|
+
end
|
305
|
+
|
306
|
+
# Todo: Add description for test test_get_3339_datetime_array
|
307
|
+
def test_get_3339_datetime_array()
|
308
|
+
|
309
|
+
# Perform the API call through the SDK function
|
310
|
+
result = self.class.controller.get_3339_datetime_array()
|
311
|
+
|
312
|
+
# Test response code
|
313
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
314
|
+
|
315
|
+
# Test whether the captured response is as we expected
|
316
|
+
assert_not_nil(result)
|
317
|
+
expected_body = JSON.parse('["2016-03-13T12:52:32.123Z","2016-03-13T12:52:32.123Z","2016-03-13T12:52:32.123Z"]')
|
318
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
319
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
320
|
+
end
|
321
|
+
|
322
|
+
# Todo: Add description for test test_get_boolean
|
323
|
+
def test_get_boolean()
|
324
|
+
|
325
|
+
# Perform the API call through the SDK function
|
326
|
+
result = self.class.controller.get_boolean()
|
327
|
+
|
328
|
+
# Test response code
|
329
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
330
|
+
|
331
|
+
# Test whether the captured response is as we expected
|
332
|
+
assert_not_nil(result)
|
333
|
+
assert_equal('true', @response_catcher.response.raw_body)
|
334
|
+
end
|
335
|
+
|
336
|
+
# Todo: Add description for test test_get_boolean_array
|
337
|
+
def test_get_boolean_array()
|
338
|
+
|
339
|
+
# Perform the API call through the SDK function
|
340
|
+
result = self.class.controller.get_boolean_array()
|
341
|
+
|
342
|
+
# Test response code
|
343
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
344
|
+
|
345
|
+
# Test whether the captured response is as we expected
|
346
|
+
assert_not_nil(result)
|
347
|
+
expected_body = JSON.parse('[true,false,true,true,false]')
|
348
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
349
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
350
|
+
end
|
351
|
+
|
352
|
+
# Todo: Add description for test test_get_headers_allow_extra
|
353
|
+
def test_get_headers_allow_extra()
|
354
|
+
|
355
|
+
# Perform the API call through the SDK function
|
356
|
+
self.class.controller.get_headers()
|
357
|
+
|
358
|
+
# Test response code
|
359
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
360
|
+
|
361
|
+
# Test headers
|
362
|
+
expected_headers = {}
|
363
|
+
expected_headers['naumanali'] = nil
|
364
|
+
expected_headers['waseemhasan'] = nil
|
365
|
+
|
366
|
+
assert(TestHelper.match_headers(expected_headers, @response_catcher.response.headers))
|
367
|
+
end
|
368
|
+
|
369
|
+
# Todo: Add description for test test_get_1123_date_time
|
370
|
+
def test_get_1123_date_time()
|
371
|
+
|
372
|
+
# Perform the API call through the SDK function
|
373
|
+
result = self.class.controller.get_1123_date_time()
|
374
|
+
|
375
|
+
# Test response code
|
376
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
377
|
+
|
378
|
+
# Test whether the captured response is as we expected
|
379
|
+
assert_not_nil(result)
|
380
|
+
assert_equal('Sun, 06 Nov 1994 08:49:37 GMT', @response_catcher.response.raw_body)
|
381
|
+
end
|
382
|
+
|
383
|
+
# Todo: Add description for test test_get_unix_date_time
|
384
|
+
def test_get_unix_date_time()
|
385
|
+
|
386
|
+
# Perform the API call through the SDK function
|
387
|
+
result = self.class.controller.get_unix_date_time()
|
388
|
+
|
389
|
+
# Test response code
|
390
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
391
|
+
|
392
|
+
# Test whether the captured response is as we expected
|
393
|
+
assert_not_nil(result)
|
394
|
+
assert_equal('1484719381', @response_catcher.response.raw_body)
|
395
|
+
end
|
396
|
+
|
397
|
+
# Todo: Add description for test test_get_1123_date_time_array
|
398
|
+
def test_get_1123_date_time_array()
|
399
|
+
|
400
|
+
# Perform the API call through the SDK function
|
401
|
+
result = self.class.controller.get_1123_date_time_array()
|
402
|
+
|
403
|
+
# Test response code
|
404
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
405
|
+
|
406
|
+
# Test whether the captured response is as we expected
|
407
|
+
assert_not_nil(result)
|
408
|
+
expected_body = JSON.parse('["Sun, 06 Nov 1994 08:49:37 GMT","Sun, 06 Nov 1994 08:49:37 GMT"]')
|
409
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
410
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
411
|
+
end
|
412
|
+
|
413
|
+
# Todo: Add description for test test_get_unix_date_time_array
|
414
|
+
def test_get_unix_date_time_array()
|
415
|
+
|
416
|
+
# Perform the API call through the SDK function
|
417
|
+
result = self.class.controller.get_unix_date_time_array()
|
418
|
+
|
419
|
+
# Test response code
|
420
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
421
|
+
|
422
|
+
# Test whether the captured response is as we expected
|
423
|
+
assert_not_nil(result)
|
424
|
+
expected_body = JSON.parse('[1484719381,1484719381]')
|
425
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
426
|
+
assert(TestHelper.match_body(expected_body, received_body))
|
427
|
+
end
|
428
|
+
|
429
|
+
end
|