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,52 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
module Tester
|
5
|
+
# TestRNstringEncoding Model.
|
6
|
+
class TestRNstringEncoding < BaseModel
|
7
|
+
# TODO: Write general description for this method
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :field
|
10
|
+
|
11
|
+
# TODO: Write general description for this method
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :name
|
14
|
+
|
15
|
+
# A mapping from model property names to API property names.
|
16
|
+
def self.names
|
17
|
+
@_hash = {} if @_hash.nil?
|
18
|
+
@_hash['field'] = 'field'
|
19
|
+
@_hash['name'] = 'name'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(field = nil,
|
24
|
+
name = nil,
|
25
|
+
additional_properties = {})
|
26
|
+
@field = field
|
27
|
+
@name = name
|
28
|
+
|
29
|
+
# Add additional model properties to the instance.
|
30
|
+
additional_properties.each do |_name, value|
|
31
|
+
instance_variable_set("@#{_name}", value)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Creates an instance of the object from a hash.
|
36
|
+
def self.from_hash(hash)
|
37
|
+
return nil unless hash
|
38
|
+
|
39
|
+
# Extract variables from the hash.
|
40
|
+
field = hash['field']
|
41
|
+
name = hash['name']
|
42
|
+
|
43
|
+
# Clean out expected properties from Hash.
|
44
|
+
names.each_value { |k| hash.delete(k) }
|
45
|
+
|
46
|
+
# Create object from extracted values.
|
47
|
+
TestRNstringEncoding.new(field,
|
48
|
+
name,
|
49
|
+
hash)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
module Tester
|
5
|
+
# TestRstringEncoding Model.
|
6
|
+
class TestRstringEncoding < BaseModel
|
7
|
+
# TODO: Write general description for this method
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :field
|
10
|
+
|
11
|
+
# TODO: Write general description for this method
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :name
|
14
|
+
|
15
|
+
# A mapping from model property names to API property names.
|
16
|
+
def self.names
|
17
|
+
@_hash = {} if @_hash.nil?
|
18
|
+
@_hash['field'] = 'field'
|
19
|
+
@_hash['name'] = 'name'
|
20
|
+
@_hash
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(field = nil,
|
24
|
+
name = nil,
|
25
|
+
additional_properties = {})
|
26
|
+
@field = field
|
27
|
+
@name = name
|
28
|
+
|
29
|
+
# Add additional model properties to the instance.
|
30
|
+
additional_properties.each do |_name, value|
|
31
|
+
instance_variable_set("@#{_name}", value)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# Creates an instance of the object from a hash.
|
36
|
+
def self.from_hash(hash)
|
37
|
+
return nil unless hash
|
38
|
+
|
39
|
+
# Extract variables from the hash.
|
40
|
+
field = hash['field']
|
41
|
+
name = hash['name']
|
42
|
+
|
43
|
+
# Clean out expected properties from Hash.
|
44
|
+
names.each_value { |k| hash.delete(k) }
|
45
|
+
|
46
|
+
# Create object from extracted values.
|
47
|
+
TestRstringEncoding.new(field,
|
48
|
+
name,
|
49
|
+
hash)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
module Tester
|
5
|
+
# Validate Model.
|
6
|
+
class Validate < BaseModel
|
7
|
+
# TODO: Write general description for this method
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :field
|
10
|
+
|
11
|
+
# TODO: Write general description for this method
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :name
|
14
|
+
|
15
|
+
# TODO: Write general description for this method
|
16
|
+
# @return [String]
|
17
|
+
attr_accessor :address
|
18
|
+
|
19
|
+
# A mapping from model property names to API property names.
|
20
|
+
def self.names
|
21
|
+
@_hash = {} if @_hash.nil?
|
22
|
+
@_hash['field'] = 'field'
|
23
|
+
@_hash['name'] = 'name'
|
24
|
+
@_hash['address'] = 'address'
|
25
|
+
@_hash
|
26
|
+
end
|
27
|
+
|
28
|
+
def initialize(field = nil,
|
29
|
+
name = nil,
|
30
|
+
address = nil,
|
31
|
+
additional_properties = {})
|
32
|
+
@field = field
|
33
|
+
@name = name
|
34
|
+
@address = address
|
35
|
+
|
36
|
+
# Add additional model properties to the instance.
|
37
|
+
additional_properties.each do |_name, value|
|
38
|
+
instance_variable_set("@#{_name}", value)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
# Creates an instance of the object from a hash.
|
43
|
+
def self.from_hash(hash)
|
44
|
+
return nil unless hash
|
45
|
+
|
46
|
+
# Extract variables from the hash.
|
47
|
+
field = hash['field']
|
48
|
+
name = hash['name']
|
49
|
+
address = hash['address']
|
50
|
+
|
51
|
+
# Clean out expected properties from Hash.
|
52
|
+
names.each_value { |k| hash.delete(k) }
|
53
|
+
|
54
|
+
# Create object from extracted values.
|
55
|
+
Validate.new(field,
|
56
|
+
name,
|
57
|
+
address,
|
58
|
+
hash)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0
|
2
|
+
# ( https://apimatic.io ).
|
3
|
+
|
4
|
+
module Tester
|
5
|
+
# tester client class.
|
6
|
+
class TesterClient
|
7
|
+
# Singleton access to response_types controller.
|
8
|
+
# @return [ResponseTypesController] Returns the controller instance.
|
9
|
+
def response_types
|
10
|
+
ResponseTypesController.instance
|
11
|
+
end
|
12
|
+
|
13
|
+
# Singleton access to form_params controller.
|
14
|
+
# @return [FormParamsController] Returns the controller instance.
|
15
|
+
def form_params
|
16
|
+
FormParamsController.instance
|
17
|
+
end
|
18
|
+
|
19
|
+
# Singleton access to body_params controller.
|
20
|
+
# @return [BodyParamsController] Returns the controller instance.
|
21
|
+
def body_params
|
22
|
+
BodyParamsController.instance
|
23
|
+
end
|
24
|
+
|
25
|
+
# Singleton access to query_param controller.
|
26
|
+
# @return [QueryParamController] Returns the controller instance.
|
27
|
+
def query_param
|
28
|
+
QueryParamController.instance
|
29
|
+
end
|
30
|
+
|
31
|
+
# Singleton access to error_codes controller.
|
32
|
+
# @return [ErrorCodesController] Returns the controller instance.
|
33
|
+
def error_codes
|
34
|
+
ErrorCodesController.instance
|
35
|
+
end
|
36
|
+
|
37
|
+
# Singleton access to echo controller.
|
38
|
+
# @return [EchoController] Returns the controller instance.
|
39
|
+
def echo
|
40
|
+
EchoController.instance
|
41
|
+
end
|
42
|
+
|
43
|
+
# Singleton access to header controller.
|
44
|
+
# @return [HeaderController] Returns the controller instance.
|
45
|
+
def header
|
46
|
+
HeaderController.instance
|
47
|
+
end
|
48
|
+
|
49
|
+
# Singleton access to template_params controller.
|
50
|
+
# @return [TemplateParamsController] Returns the controller instance.
|
51
|
+
def template_params
|
52
|
+
TemplateParamsController.instance
|
53
|
+
end
|
54
|
+
|
55
|
+
# Returns the configuration class for easy access.
|
56
|
+
# @return [Configuration] Returns the actual configuration class.
|
57
|
+
def config
|
58
|
+
Configuration
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# This file was automatically generated for Stamplay by APIMATIC v2.0 ( https://apimatic.io ).
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'test/unit'
|
5
|
+
require 'tester.rb'
|
6
|
+
require_relative '../test_helper.rb'
|
7
|
+
require_relative '../http_response_catcher.rb'
|
8
|
+
|
9
|
+
class ControllerTestBase < Test::Unit::TestCase
|
10
|
+
include Tester
|
11
|
+
|
12
|
+
class << self
|
13
|
+
attr_accessor :controller
|
14
|
+
end
|
15
|
+
|
16
|
+
# Called only once for a test class before any test has executed.
|
17
|
+
def self.startup
|
18
|
+
@@api_client = TesterClient.new
|
19
|
+
@@request_timeout = 60
|
20
|
+
@@assert_precision = 0.1
|
21
|
+
|
22
|
+
# Set Configuration parameters for test execution
|
23
|
+
Configuration.port = '3000'
|
24
|
+
Configuration.suites = SuiteCode::DIAMONDS
|
25
|
+
Configuration.environment = Configuration::Environment::TESTING
|
26
|
+
end
|
27
|
+
|
28
|
+
# Called once before every test case.
|
29
|
+
def setup
|
30
|
+
@response_catcher = HttpResponseCatcher.new
|
31
|
+
self.class.controller.http_call_back = @response_catcher
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,1210 @@
|
|
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 BodyParamsControllerTests < ControllerTestBase
|
6
|
+
# Called only once for the class before any test has executed
|
7
|
+
def self.startup
|
8
|
+
self.controller = @@api_client.body_params
|
9
|
+
end
|
10
|
+
|
11
|
+
# Todo: Add description for test test_delete_plaintext_test
|
12
|
+
def test_delete_plaintext_test()
|
13
|
+
# Parameters for the API call
|
14
|
+
text_string = 'farhan
|
15
|
+
nouman'
|
16
|
+
|
17
|
+
# Perform the API call through the SDK function
|
18
|
+
result = self.class.controller.send_delete_plain_text(text_string)
|
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
|
+
# Todo: Add description for test test_send_delete_body
|
31
|
+
def test_send_delete_body()
|
32
|
+
# Parameters for the API call
|
33
|
+
body = DeleteBody.from_hash(JSON.parse('{"name":"farhan","field":"QA"}'))
|
34
|
+
|
35
|
+
# Perform the API call through the SDK function
|
36
|
+
result = self.class.controller.send_delete_body(body)
|
37
|
+
|
38
|
+
# Test response code
|
39
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
40
|
+
|
41
|
+
# Test whether the captured response is as we expected
|
42
|
+
assert_not_nil(result)
|
43
|
+
expected_body = JSON.parse('{"passed":true}')
|
44
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
45
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
46
|
+
end
|
47
|
+
|
48
|
+
# Todo: Add description for test test_send_delete_body_with_multiliner_name
|
49
|
+
def test_send_delete_body_with_multiliner_name()
|
50
|
+
# Parameters for the API call
|
51
|
+
body = DeleteBody.from_hash(JSON.parse('{"name":"farhan\\nnouman","field":"QA"}'))
|
52
|
+
|
53
|
+
# Perform the API call through the SDK function
|
54
|
+
result = self.class.controller.send_delete_body(body)
|
55
|
+
|
56
|
+
# Test response code
|
57
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
58
|
+
|
59
|
+
# Test whether the captured response is as we expected
|
60
|
+
assert_not_nil(result)
|
61
|
+
expected_body = JSON.parse('{"passed":true}')
|
62
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
63
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
64
|
+
end
|
65
|
+
|
66
|
+
# Todo: Add description for test test_send_delete_body_with_special_field_name
|
67
|
+
def test_send_delete_body_with_special_field_name()
|
68
|
+
# Parameters for the API call
|
69
|
+
body = DeleteBody.from_hash(JSON.parse('{"name":"farhan","field":"&&&"}'))
|
70
|
+
|
71
|
+
# Perform the API call through the SDK function
|
72
|
+
result = self.class.controller.send_delete_body(body)
|
73
|
+
|
74
|
+
# Test response code
|
75
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
76
|
+
|
77
|
+
# Test whether the captured response is as we expected
|
78
|
+
assert_not_nil(result)
|
79
|
+
expected_body = JSON.parse('{"passed":true}')
|
80
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
81
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
82
|
+
end
|
83
|
+
|
84
|
+
# Todo: Add description for test test_send_delete_body_with_blank_field
|
85
|
+
def test_send_delete_body_with_blank_field()
|
86
|
+
# Parameters for the API call
|
87
|
+
body = DeleteBody.from_hash(JSON.parse('{"name":"farhan","field":" "}'))
|
88
|
+
|
89
|
+
# Perform the API call through the SDK function
|
90
|
+
result = self.class.controller.send_delete_body(body)
|
91
|
+
|
92
|
+
# Test response code
|
93
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
94
|
+
|
95
|
+
# Test whether the captured response is as we expected
|
96
|
+
assert_not_nil(result)
|
97
|
+
expected_body = JSON.parse('{"passed":true}')
|
98
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
99
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
100
|
+
end
|
101
|
+
|
102
|
+
# Todo: Add description for test test_send_delete_body_with_blank_name
|
103
|
+
def test_send_delete_body_with_blank_name()
|
104
|
+
# Parameters for the API call
|
105
|
+
body = DeleteBody.from_hash(JSON.parse('{"name":" ","field":"QA"}'))
|
106
|
+
|
107
|
+
# Perform the API call through the SDK function
|
108
|
+
result = self.class.controller.send_delete_body(body)
|
109
|
+
|
110
|
+
# Test response code
|
111
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
112
|
+
|
113
|
+
# Test whether the captured response is as we expected
|
114
|
+
assert_not_nil(result)
|
115
|
+
expected_body = JSON.parse('{"passed":true}')
|
116
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
117
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
118
|
+
end
|
119
|
+
|
120
|
+
# Todo: Add description for test test_send_delete_body_with_blank_name_and_field
|
121
|
+
def test_send_delete_body_with_blank_name_and_field()
|
122
|
+
# Parameters for the API call
|
123
|
+
body = DeleteBody.from_hash(JSON.parse('{"name":" ","field":" "}'))
|
124
|
+
|
125
|
+
# Perform the API call through the SDK function
|
126
|
+
result = self.class.controller.send_delete_body(body)
|
127
|
+
|
128
|
+
# Test response code
|
129
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
130
|
+
|
131
|
+
# Test whether the captured response is as we expected
|
132
|
+
assert_not_nil(result)
|
133
|
+
expected_body = JSON.parse('{"passed":true}')
|
134
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
135
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
136
|
+
end
|
137
|
+
|
138
|
+
# Todo: Add description for test test_send_date_array
|
139
|
+
def test_send_date_array()
|
140
|
+
# Parameters for the API call
|
141
|
+
dates = JSON.parse('["1994-02-13","1994-02-13"]').map { |element| Date.iso8601(element) }
|
142
|
+
|
143
|
+
# Perform the API call through the SDK function
|
144
|
+
result = self.class.controller.send_date_array(dates)
|
145
|
+
|
146
|
+
# Test response code
|
147
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
148
|
+
|
149
|
+
# Test whether the captured response is as we expected
|
150
|
+
assert_not_nil(result)
|
151
|
+
expected_body = JSON.parse('{"passed":true}')
|
152
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
153
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
154
|
+
end
|
155
|
+
|
156
|
+
# Todo: Add description for test test_send_date
|
157
|
+
def test_send_date()
|
158
|
+
# Parameters for the API call
|
159
|
+
date = Date.parse('1994-02-13')
|
160
|
+
|
161
|
+
# Perform the API call through the SDK function
|
162
|
+
result = self.class.controller.send_date(date)
|
163
|
+
|
164
|
+
# Test response code
|
165
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
166
|
+
|
167
|
+
# Test whether the captured response is as we expected
|
168
|
+
assert_not_nil(result)
|
169
|
+
expected_body = JSON.parse('{"passed":true}')
|
170
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
171
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
172
|
+
end
|
173
|
+
|
174
|
+
# Todo: Add description for test test_send_unix_date_time
|
175
|
+
def test_send_unix_date_time()
|
176
|
+
# Parameters for the API call
|
177
|
+
datetime = Time.at(1484719381).utc.to_datetime
|
178
|
+
|
179
|
+
# Perform the API call through the SDK function
|
180
|
+
result = self.class.controller.send_unix_date_time(datetime)
|
181
|
+
|
182
|
+
# Test response code
|
183
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
184
|
+
|
185
|
+
# Test whether the captured response is as we expected
|
186
|
+
assert_not_nil(result)
|
187
|
+
expected_body = JSON.parse('{"passed":true}')
|
188
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
189
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
190
|
+
end
|
191
|
+
|
192
|
+
# Todo: Add description for test test_send_rfc_1123_date_time
|
193
|
+
def test_send_rfc_1123_date_time()
|
194
|
+
# Parameters for the API call
|
195
|
+
datetime = DateTime.httpdate('Sun, 06 Nov 1994 08:49:37 GMT')
|
196
|
+
|
197
|
+
# Perform the API call through the SDK function
|
198
|
+
result = self.class.controller.send_rfc_1123_date_time(datetime)
|
199
|
+
|
200
|
+
# Test response code
|
201
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
202
|
+
|
203
|
+
# Test whether the captured response is as we expected
|
204
|
+
assert_not_nil(result)
|
205
|
+
expected_body = JSON.parse('{"passed":true}')
|
206
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
207
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
208
|
+
end
|
209
|
+
|
210
|
+
# Todo: Add description for test test_send_rfc_3339_date_time
|
211
|
+
def test_send_rfc_3339_date_time()
|
212
|
+
# Parameters for the API call
|
213
|
+
datetime = DateTime.rfc3339('1994-02-13T14:01:54.9571247Z')
|
214
|
+
|
215
|
+
# Perform the API call through the SDK function
|
216
|
+
result = self.class.controller.send_rfc_3339_date_time(datetime)
|
217
|
+
|
218
|
+
# Test response code
|
219
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
220
|
+
|
221
|
+
# Test whether the captured response is as we expected
|
222
|
+
assert_not_nil(result)
|
223
|
+
expected_body = JSON.parse('{"passed":true}')
|
224
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
225
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
226
|
+
end
|
227
|
+
|
228
|
+
# Todo: Add description for test test_send_unix_date_time_array
|
229
|
+
def test_send_unix_date_time_array()
|
230
|
+
# Parameters for the API call
|
231
|
+
datetimes = JSON.parse('[1484719381,1484719381]').map { |element| Time.at(element).utc.to_datetime }
|
232
|
+
|
233
|
+
# Perform the API call through the SDK function
|
234
|
+
result = self.class.controller.send_unix_date_time_array(datetimes)
|
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
|
+
expected_body = JSON.parse('{"passed":true}')
|
242
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
243
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
244
|
+
end
|
245
|
+
|
246
|
+
# Todo: Add description for test test_send_rfc_1123_date_time_array
|
247
|
+
def test_send_rfc_1123_date_time_array()
|
248
|
+
# Parameters for the API call
|
249
|
+
datetimes = JSON.parse('["Sun, 06 Nov 1994 08:49:37 GMT","Sun, 06 Nov 1994 08:49:37 GMT"]').map { |element| DateTime.httpdate(element) }
|
250
|
+
|
251
|
+
# Perform the API call through the SDK function
|
252
|
+
result = self.class.controller.send_rfc_1123_date_time_array(datetimes)
|
253
|
+
|
254
|
+
# Test response code
|
255
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
256
|
+
|
257
|
+
# Test whether the captured response is as we expected
|
258
|
+
assert_not_nil(result)
|
259
|
+
expected_body = JSON.parse('{"passed":true}')
|
260
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
261
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
262
|
+
end
|
263
|
+
|
264
|
+
# Todo: Add description for test test_send_rfc_3339_date_time_array
|
265
|
+
def test_send_rfc_3339_date_time_array()
|
266
|
+
# Parameters for the API call
|
267
|
+
datetimes = JSON.parse('["1994-02-13T14:01:54.9571247Z","1994-02-13T14:01:54.9571247Z"]').map { |element| DateTime.rfc3339(element) }
|
268
|
+
|
269
|
+
# Perform the API call through the SDK function
|
270
|
+
result = self.class.controller.send_rfc_3339_date_time_array(datetimes)
|
271
|
+
|
272
|
+
# Test response code
|
273
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
274
|
+
|
275
|
+
# Test whether the captured response is as we expected
|
276
|
+
assert_not_nil(result)
|
277
|
+
expected_body = JSON.parse('{"passed":true}')
|
278
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
279
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
280
|
+
end
|
281
|
+
|
282
|
+
# Todo: Add description for test test_send_string_array
|
283
|
+
def test_send_string_array()
|
284
|
+
# Parameters for the API call
|
285
|
+
sarray = JSON.parse('["abc","def"]')
|
286
|
+
|
287
|
+
# Perform the API call through the SDK function
|
288
|
+
result = self.class.controller.send_string_array(sarray)
|
289
|
+
|
290
|
+
# Test response code
|
291
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
292
|
+
|
293
|
+
# Test whether the captured response is as we expected
|
294
|
+
assert_not_nil(result)
|
295
|
+
expected_body = JSON.parse('{"passed":true}')
|
296
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
297
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
298
|
+
end
|
299
|
+
|
300
|
+
# Todo: Add description for test test_update_string_with_body
|
301
|
+
def test_update_string_with_body()
|
302
|
+
# Parameters for the API call
|
303
|
+
value = 'TestString'
|
304
|
+
|
305
|
+
# Perform the API call through the SDK function
|
306
|
+
result = self.class.controller.update_string(value)
|
307
|
+
|
308
|
+
# Test response code
|
309
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
310
|
+
|
311
|
+
# Test whether the captured response is as we expected
|
312
|
+
assert_not_nil(result)
|
313
|
+
expected_body = JSON.parse('{"passed":true}')
|
314
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
315
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
316
|
+
end
|
317
|
+
|
318
|
+
# Todo: Add description for test test_update_special_string_with_body
|
319
|
+
def test_update_special_string_with_body()
|
320
|
+
# Parameters for the API call
|
321
|
+
value = '$%^!@#$%^&*'
|
322
|
+
|
323
|
+
# Perform the API call through the SDK function
|
324
|
+
result = self.class.controller.update_string(value)
|
325
|
+
|
326
|
+
# Test response code
|
327
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
328
|
+
|
329
|
+
# Test whether the captured response is as we expected
|
330
|
+
assert_not_nil(result)
|
331
|
+
expected_body = JSON.parse('{"passed":true}')
|
332
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
333
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
334
|
+
end
|
335
|
+
|
336
|
+
# Todo: Add description for test test_update_multiliner_string_with_body
|
337
|
+
def test_update_multiliner_string_with_body()
|
338
|
+
# Parameters for the API call
|
339
|
+
value = 'TestString
|
340
|
+
nouman'
|
341
|
+
|
342
|
+
# Perform the API call through the SDK function
|
343
|
+
result = self.class.controller.update_string(value)
|
344
|
+
|
345
|
+
# Test response code
|
346
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
347
|
+
|
348
|
+
# Test whether the captured response is as we expected
|
349
|
+
assert_not_nil(result)
|
350
|
+
expected_body = JSON.parse('{"passed":true}')
|
351
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
352
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
353
|
+
end
|
354
|
+
|
355
|
+
# Todo: Add description for test test_update_string_with_body_corner_case
|
356
|
+
def test_update_string_with_body_corner_case()
|
357
|
+
# Parameters for the API call
|
358
|
+
value = ''
|
359
|
+
|
360
|
+
# Perform the API call through the SDK function
|
361
|
+
assert_raise('APIException'){
|
362
|
+
result = self.class.controller.update_string(value)
|
363
|
+
}
|
364
|
+
|
365
|
+
# Test response code
|
366
|
+
assert_equal(@response_catcher.response.status_code, 400)
|
367
|
+
end
|
368
|
+
|
369
|
+
# Todo: Add description for test test_send_integer_array
|
370
|
+
def test_send_integer_array()
|
371
|
+
# Parameters for the API call
|
372
|
+
integers = JSON.parse('[1,2,3,4,5]')
|
373
|
+
|
374
|
+
# Perform the API call through the SDK function
|
375
|
+
result = self.class.controller.send_integer_array(integers)
|
376
|
+
|
377
|
+
# Test response code
|
378
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
379
|
+
|
380
|
+
# Test whether the captured response is as we expected
|
381
|
+
assert_not_nil(result)
|
382
|
+
expected_body = JSON.parse('{"passed":true}')
|
383
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
384
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
385
|
+
end
|
386
|
+
|
387
|
+
# Todo: Add description for test test_wrap_body_in_object
|
388
|
+
def test_wrap_body_in_object()
|
389
|
+
# Parameters for the API call
|
390
|
+
field = 'QA'
|
391
|
+
name = 'farhan'
|
392
|
+
|
393
|
+
# Perform the API call through the SDK function
|
394
|
+
result = self.class.controller.wrap_body_in_object(field, name)
|
395
|
+
|
396
|
+
# Test response code
|
397
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
398
|
+
|
399
|
+
# Test whether the captured response is as we expected
|
400
|
+
assert_not_nil(result)
|
401
|
+
expected_body = JSON.parse('{"passed":true}')
|
402
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
403
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
404
|
+
end
|
405
|
+
|
406
|
+
# Todo: Add description for test test_wrap_body_in_object_1
|
407
|
+
def test_wrap_body_in_object_1()
|
408
|
+
# Parameters for the API call
|
409
|
+
field = ''
|
410
|
+
name = 'farhan'
|
411
|
+
|
412
|
+
# Perform the API call through the SDK function
|
413
|
+
result = self.class.controller.wrap_body_in_object(field, name)
|
414
|
+
|
415
|
+
# Test response code
|
416
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
417
|
+
|
418
|
+
# Test whether the captured response is as we expected
|
419
|
+
assert_not_nil(result)
|
420
|
+
expected_body = JSON.parse('{"passed":true}')
|
421
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
422
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
423
|
+
end
|
424
|
+
|
425
|
+
# Todo: Add description for test test_wrap_body_in_object_2
|
426
|
+
def test_wrap_body_in_object_2()
|
427
|
+
# Parameters for the API call
|
428
|
+
field = 'QA'
|
429
|
+
name = ''
|
430
|
+
|
431
|
+
# Perform the API call through the SDK function
|
432
|
+
result = self.class.controller.wrap_body_in_object(field, name)
|
433
|
+
|
434
|
+
# Test response code
|
435
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
436
|
+
|
437
|
+
# Test whether the captured response is as we expected
|
438
|
+
assert_not_nil(result)
|
439
|
+
expected_body = JSON.parse('{"passed":true}')
|
440
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
441
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
442
|
+
end
|
443
|
+
|
444
|
+
# Todo: Add description for test test_wrap_body_in_object_3
|
445
|
+
def test_wrap_body_in_object_3()
|
446
|
+
# Parameters for the API call
|
447
|
+
field = '$$'
|
448
|
+
name = '$$'
|
449
|
+
|
450
|
+
# Perform the API call through the SDK function
|
451
|
+
result = self.class.controller.wrap_body_in_object(field, name)
|
452
|
+
|
453
|
+
# Test response code
|
454
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
455
|
+
|
456
|
+
# Test whether the captured response is as we expected
|
457
|
+
assert_not_nil(result)
|
458
|
+
expected_body = JSON.parse('{"passed":true}')
|
459
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
460
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
461
|
+
end
|
462
|
+
|
463
|
+
# Todo: Add description for test test_wrap_body_in_object_4
|
464
|
+
def test_wrap_body_in_object_4()
|
465
|
+
# Parameters for the API call
|
466
|
+
field = 'QA&farhan'
|
467
|
+
name = 'QA&farhan'
|
468
|
+
|
469
|
+
# Perform the API call through the SDK function
|
470
|
+
result = self.class.controller.wrap_body_in_object(field, name)
|
471
|
+
|
472
|
+
# Test response code
|
473
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
474
|
+
|
475
|
+
# Test whether the captured response is as we expected
|
476
|
+
assert_not_nil(result)
|
477
|
+
expected_body = JSON.parse('{"passed":true}')
|
478
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
479
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
480
|
+
end
|
481
|
+
|
482
|
+
# Todo: Add description for test test_additional_model_properties
|
483
|
+
def test_additional_model_properties()
|
484
|
+
# Parameters for the API call
|
485
|
+
model = AdditionalModelParameters.from_hash(JSON.parse(
|
486
|
+
'{"name":"farhan","field":"QA","address":"Ghori Town","Job":{"company":"APIM'\
|
487
|
+
'ATIC","location":"NUST"}}'
|
488
|
+
))
|
489
|
+
|
490
|
+
# Perform the API call through the SDK function
|
491
|
+
result = self.class.controller.additional_model_parameters(model)
|
492
|
+
|
493
|
+
# Test response code
|
494
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
495
|
+
|
496
|
+
# Test whether the captured response is as we expected
|
497
|
+
assert_not_nil(result)
|
498
|
+
expected_body = JSON.parse('{"passed":true}')
|
499
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
500
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
501
|
+
end
|
502
|
+
|
503
|
+
# Todo: Add description for test test_validate_required_param_test
|
504
|
+
def test_validate_required_param_test()
|
505
|
+
# Parameters for the API call
|
506
|
+
model = Validate.from_hash(JSON.parse('{"name":"farhan","field":"QA"}'))
|
507
|
+
option = '...'
|
508
|
+
|
509
|
+
# Perform the API call through the SDK function
|
510
|
+
result = self.class.controller.validate_required_parameter(model, option)
|
511
|
+
|
512
|
+
# Test response code
|
513
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
514
|
+
|
515
|
+
# Test whether the captured response is as we expected
|
516
|
+
assert_not_nil(result)
|
517
|
+
expected_body = JSON.parse('{"passed":true}')
|
518
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
519
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
520
|
+
end
|
521
|
+
|
522
|
+
# Todo: Add description for test test_additional_model_properties_1
|
523
|
+
def test_additional_model_properties_1()
|
524
|
+
# Parameters for the API call
|
525
|
+
model = AdditionalModelParameters.from_hash(JSON.parse(
|
526
|
+
'{"name":"farhan","field":"QA","address":"Ghori Town","Job":{"company":"APIM'\
|
527
|
+
'ATIC","location":"NUST"}}'
|
528
|
+
))
|
529
|
+
|
530
|
+
# Perform the API call through the SDK function
|
531
|
+
result = self.class.controller.additional_model_parameters_1(model)
|
532
|
+
|
533
|
+
# Test response code
|
534
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
535
|
+
|
536
|
+
# Test whether the captured response is as we expected
|
537
|
+
assert_not_nil(result)
|
538
|
+
expected_body = JSON.parse('{"passed":true}')
|
539
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
540
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
541
|
+
end
|
542
|
+
|
543
|
+
# Todo: Add description for test test_send_model
|
544
|
+
def test_send_model()
|
545
|
+
# Parameters for the API call
|
546
|
+
model = Employee.from_hash(JSON.parse(
|
547
|
+
'{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid":'\
|
548
|
+
'"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"'\
|
549
|
+
',"salary":20000,"department":"Software Development","joiningDay":"Saturday"'\
|
550
|
+
',"workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","n'\
|
551
|
+
'ame":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"123'\
|
552
|
+
'321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","sa'\
|
553
|
+
'lary":20000,"department":"Software Development","joiningDay":"Saturday","wo'\
|
554
|
+
'rkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wife'\
|
555
|
+
'","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"1'\
|
556
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid"'\
|
557
|
+
',"age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"19'\
|
558
|
+
'94-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 N'\
|
559
|
+
'ov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futur'\
|
560
|
+
'e Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthd'\
|
561
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futur'\
|
562
|
+
'e Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthda'\
|
563
|
+
'y":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun'\
|
564
|
+
', 06 Nov 1994 08:49:37 GMT"}'
|
565
|
+
))
|
566
|
+
|
567
|
+
# Perform the API call through the SDK function
|
568
|
+
result = self.class.controller.send_model(model)
|
569
|
+
|
570
|
+
# Test response code
|
571
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
572
|
+
|
573
|
+
# Test whether the captured response is as we expected
|
574
|
+
assert_not_nil(result)
|
575
|
+
expected_body = JSON.parse('{"passed":true}')
|
576
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
577
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
578
|
+
end
|
579
|
+
|
580
|
+
# Todo: Add description for test test_send_model_array
|
581
|
+
def test_send_model_array()
|
582
|
+
# Parameters for the API call
|
583
|
+
models = JSON.parse(
|
584
|
+
'[{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid"'\
|
585
|
+
':"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z'\
|
586
|
+
'","salary":20000,"department":"Software Development","joiningDay":"Saturday'\
|
587
|
+
'","workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","'\
|
588
|
+
'name":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"12'\
|
589
|
+
'3321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","s'\
|
590
|
+
'alary":20000,"department":"Software Development","joiningDay":"Saturday","w'\
|
591
|
+
'orkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wif'\
|
592
|
+
'e","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"'\
|
593
|
+
'1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid'\
|
594
|
+
'","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"1'\
|
595
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 '\
|
596
|
+
'Nov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futu'\
|
597
|
+
're Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birth'\
|
598
|
+
'day":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futu'\
|
599
|
+
're Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthd'\
|
600
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Su'\
|
601
|
+
'n, 06 Nov 1994 08:49:37 GMT"},{"name":"Shahid Khaliq","age":5147483645,"add'\
|
602
|
+
'ress":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":'\
|
603
|
+
'"1994-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Develo'\
|
604
|
+
'pment","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],'\
|
605
|
+
'"boss":{"personType":"Boss","name":"Zeeshan Ejaz","age":5147483645,"address'\
|
606
|
+
'":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":"199'\
|
607
|
+
'4-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Developmen'\
|
608
|
+
't","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],"dep'\
|
609
|
+
'endents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, S # 20'\
|
610
|
+
'","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9'\
|
611
|
+
'571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S # 20"'\
|
612
|
+
',"uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.95'\
|
613
|
+
'71247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT","promotedAt":1484719381'\
|
614
|
+
'},"dependents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, '\
|
615
|
+
'S # 20","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:0'\
|
616
|
+
'1:54.9571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S'\
|
617
|
+
' # 20","uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01'\
|
618
|
+
':54.9571247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT"}]'
|
619
|
+
).map { |element| Employee.from_hash(element) }
|
620
|
+
|
621
|
+
# Perform the API call through the SDK function
|
622
|
+
result = self.class.controller.send_model_array(models)
|
623
|
+
|
624
|
+
# Test response code
|
625
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
626
|
+
|
627
|
+
# Test whether the captured response is as we expected
|
628
|
+
assert_not_nil(result)
|
629
|
+
expected_body = JSON.parse('{"passed":true}')
|
630
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
631
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
632
|
+
end
|
633
|
+
|
634
|
+
# Todo: Add description for test test_send_dynamic
|
635
|
+
def test_send_dynamic()
|
636
|
+
# Parameters for the API call
|
637
|
+
dynamic = JSON.parse('{"uid":"1123213","name":"Shahid"}')
|
638
|
+
|
639
|
+
# Perform the API call through the SDK function
|
640
|
+
result = self.class.controller.send_dynamic(dynamic)
|
641
|
+
|
642
|
+
# Test response code
|
643
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
644
|
+
|
645
|
+
# Test whether the captured response is as we expected
|
646
|
+
assert_not_nil(result)
|
647
|
+
expected_body = JSON.parse('{"passed":true}')
|
648
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
649
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
650
|
+
end
|
651
|
+
|
652
|
+
# Todo: Add description for test test_send_string
|
653
|
+
def test_send_string()
|
654
|
+
# Parameters for the API call
|
655
|
+
value = 'TestString'
|
656
|
+
|
657
|
+
# Perform the API call through the SDK function
|
658
|
+
result = self.class.controller.send_string(value)
|
659
|
+
|
660
|
+
# Test response code
|
661
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
662
|
+
|
663
|
+
# Test whether the captured response is as we expected
|
664
|
+
assert_not_nil(result)
|
665
|
+
expected_body = JSON.parse('{"passed":true}')
|
666
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
667
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
668
|
+
end
|
669
|
+
|
670
|
+
# Todo: Add description for test test_send_multiliner_string
|
671
|
+
def test_send_multiliner_string()
|
672
|
+
# Parameters for the API call
|
673
|
+
value = 'TestString
|
674
|
+
nouman'
|
675
|
+
|
676
|
+
# Perform the API call through the SDK function
|
677
|
+
result = self.class.controller.send_string(value)
|
678
|
+
|
679
|
+
# Test response code
|
680
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
681
|
+
|
682
|
+
# Test whether the captured response is as we expected
|
683
|
+
assert_not_nil(result)
|
684
|
+
expected_body = JSON.parse('{"passed":true}')
|
685
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
686
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
687
|
+
end
|
688
|
+
|
689
|
+
# Todo: Add description for test test_send_string_with_special_characters
|
690
|
+
def test_send_string_with_special_characters()
|
691
|
+
# Parameters for the API call
|
692
|
+
value = '$%^!@#$%^&*'
|
693
|
+
|
694
|
+
# Perform the API call through the SDK function
|
695
|
+
result = self.class.controller.send_string(value)
|
696
|
+
|
697
|
+
# Test response code
|
698
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
699
|
+
|
700
|
+
# Test whether the captured response is as we expected
|
701
|
+
assert_not_nil(result)
|
702
|
+
expected_body = JSON.parse('{"passed":true}')
|
703
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
704
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
705
|
+
end
|
706
|
+
|
707
|
+
# Todo: Add description for test test_send_string_with_only_space
|
708
|
+
def test_send_string_with_only_space()
|
709
|
+
# Parameters for the API call
|
710
|
+
value = ' '
|
711
|
+
|
712
|
+
# Perform the API call through the SDK function
|
713
|
+
result = self.class.controller.send_string(value)
|
714
|
+
|
715
|
+
# Test response code
|
716
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
717
|
+
|
718
|
+
# Test whether the captured response is as we expected
|
719
|
+
assert_not_nil(result)
|
720
|
+
expected_body = JSON.parse('{"passed":true}')
|
721
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
722
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
723
|
+
end
|
724
|
+
|
725
|
+
# Todo: Add description for test test_send_string_enum_array
|
726
|
+
def test_send_string_enum_array()
|
727
|
+
# Parameters for the API call
|
728
|
+
days = JSON.parse('["Tuesday","Saturday","Wednesday","Monday","Sunday"]')
|
729
|
+
|
730
|
+
# Perform the API call through the SDK function
|
731
|
+
result = self.class.controller.send_string_enum_array(days)
|
732
|
+
|
733
|
+
# Test response code
|
734
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
735
|
+
|
736
|
+
# Test whether the captured response is as we expected
|
737
|
+
assert_not_nil(result)
|
738
|
+
expected_body = JSON.parse('{"passed":true}')
|
739
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
740
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
741
|
+
end
|
742
|
+
|
743
|
+
# Todo: Add description for test test_send_integer_enum_array
|
744
|
+
def test_send_integer_enum_array()
|
745
|
+
# Parameters for the API call
|
746
|
+
suites = JSON.parse('[1,3,4,2,3]')
|
747
|
+
|
748
|
+
# Perform the API call through the SDK function
|
749
|
+
result = self.class.controller.send_integer_enum_array(suites)
|
750
|
+
|
751
|
+
# Test response code
|
752
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
753
|
+
|
754
|
+
# Test whether the captured response is as we expected
|
755
|
+
assert_not_nil(result)
|
756
|
+
expected_body = JSON.parse('{"passed":true}')
|
757
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
758
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
759
|
+
end
|
760
|
+
|
761
|
+
# Todo: Add description for test test_update_model_with_body
|
762
|
+
def test_update_model_with_body()
|
763
|
+
# Parameters for the API call
|
764
|
+
model = Employee.from_hash(JSON.parse(
|
765
|
+
'{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid":'\
|
766
|
+
'"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"'\
|
767
|
+
',"salary":20000,"department":"Software Development","joiningDay":"Saturday"'\
|
768
|
+
',"workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","n'\
|
769
|
+
'ame":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"123'\
|
770
|
+
'321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","sa'\
|
771
|
+
'lary":20000,"department":"Software Development","joiningDay":"Saturday","wo'\
|
772
|
+
'rkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wife'\
|
773
|
+
'","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"1'\
|
774
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid"'\
|
775
|
+
',"age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"19'\
|
776
|
+
'94-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 N'\
|
777
|
+
'ov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futur'\
|
778
|
+
'e Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthd'\
|
779
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futur'\
|
780
|
+
'e Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthda'\
|
781
|
+
'y":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun'\
|
782
|
+
', 06 Nov 1994 08:49:37 GMT"}'
|
783
|
+
))
|
784
|
+
|
785
|
+
# Perform the API call through the SDK function
|
786
|
+
result = self.class.controller.update_model(model)
|
787
|
+
|
788
|
+
# Test response code
|
789
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
790
|
+
|
791
|
+
# Test whether the captured response is as we expected
|
792
|
+
assert_not_nil(result)
|
793
|
+
expected_body = JSON.parse('{"passed":true}')
|
794
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
795
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
796
|
+
end
|
797
|
+
|
798
|
+
# Todo: Add description for test test_send_delete_body_with_model
|
799
|
+
def test_send_delete_body_with_model()
|
800
|
+
# Parameters for the API call
|
801
|
+
model = Employee.from_hash(JSON.parse(
|
802
|
+
'{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid":'\
|
803
|
+
'"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"'\
|
804
|
+
',"salary":20000,"department":"Software Development","joiningDay":"Saturday"'\
|
805
|
+
',"workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","n'\
|
806
|
+
'ame":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"123'\
|
807
|
+
'321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","sa'\
|
808
|
+
'lary":20000,"department":"Software Development","joiningDay":"Saturday","wo'\
|
809
|
+
'rkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wife'\
|
810
|
+
'","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"1'\
|
811
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid"'\
|
812
|
+
',"age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"19'\
|
813
|
+
'94-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 N'\
|
814
|
+
'ov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futur'\
|
815
|
+
'e Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthd'\
|
816
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futur'\
|
817
|
+
'e Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthda'\
|
818
|
+
'y":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun'\
|
819
|
+
', 06 Nov 1994 08:49:37 GMT"}'
|
820
|
+
))
|
821
|
+
|
822
|
+
# Perform the API call through the SDK function
|
823
|
+
result = self.class.controller.send_delete_body_with_model(model)
|
824
|
+
|
825
|
+
# Test response code
|
826
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
827
|
+
|
828
|
+
# Test whether the captured response is as we expected
|
829
|
+
assert_not_nil(result)
|
830
|
+
expected_body = JSON.parse('{"passed":true}')
|
831
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
832
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
833
|
+
end
|
834
|
+
|
835
|
+
# Todo: Add description for test test_send_delete_body_with_model_array
|
836
|
+
def test_send_delete_body_with_model_array()
|
837
|
+
# Parameters for the API call
|
838
|
+
models = JSON.parse(
|
839
|
+
'[{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid"'\
|
840
|
+
':"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z'\
|
841
|
+
'","salary":20000,"department":"Software Development","joiningDay":"Saturday'\
|
842
|
+
'","workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","'\
|
843
|
+
'name":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"12'\
|
844
|
+
'3321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","s'\
|
845
|
+
'alary":20000,"department":"Software Development","joiningDay":"Saturday","w'\
|
846
|
+
'orkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wif'\
|
847
|
+
'e","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"'\
|
848
|
+
'1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid'\
|
849
|
+
'","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"1'\
|
850
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 '\
|
851
|
+
'Nov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futu'\
|
852
|
+
're Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birth'\
|
853
|
+
'day":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futu'\
|
854
|
+
're Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthd'\
|
855
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Su'\
|
856
|
+
'n, 06 Nov 1994 08:49:37 GMT"},{"name":"Shahid Khaliq","age":5147483645,"add'\
|
857
|
+
'ress":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":'\
|
858
|
+
'"1994-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Develo'\
|
859
|
+
'pment","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],'\
|
860
|
+
'"boss":{"personType":"Boss","name":"Zeeshan Ejaz","age":5147483645,"address'\
|
861
|
+
'":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":"199'\
|
862
|
+
'4-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Developmen'\
|
863
|
+
't","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],"dep'\
|
864
|
+
'endents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, S # 20'\
|
865
|
+
'","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9'\
|
866
|
+
'571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S # 20"'\
|
867
|
+
',"uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.95'\
|
868
|
+
'71247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT","promotedAt":1484719381'\
|
869
|
+
'},"dependents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, '\
|
870
|
+
'S # 20","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:0'\
|
871
|
+
'1:54.9571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S'\
|
872
|
+
' # 20","uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01'\
|
873
|
+
':54.9571247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT"}]'
|
874
|
+
).map { |element| Employee.from_hash(element) }
|
875
|
+
|
876
|
+
# Perform the API call through the SDK function
|
877
|
+
result = self.class.controller.send_delete_body_with_model_array(models)
|
878
|
+
|
879
|
+
# Test response code
|
880
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
881
|
+
|
882
|
+
# Test whether the captured response is as we expected
|
883
|
+
assert_not_nil(result)
|
884
|
+
expected_body = JSON.parse('{"passed":true}')
|
885
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
886
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
887
|
+
end
|
888
|
+
|
889
|
+
# Todo: Add description for test test_update_model_array_with_body
|
890
|
+
def test_update_model_array_with_body()
|
891
|
+
# Parameters for the API call
|
892
|
+
models = JSON.parse(
|
893
|
+
'[{"name":"Shahid Khaliq","age":5147483645,"address":"H # 531, S # 20","uid"'\
|
894
|
+
':"123321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z'\
|
895
|
+
'","salary":20000,"department":"Software Development","joiningDay":"Saturday'\
|
896
|
+
'","workingDays":["Monday","Tuesday","Friday"],"boss":{"personType":"Boss","'\
|
897
|
+
'name":"Zeeshan Ejaz","age":5147483645,"address":"H # 531, S # 20","uid":"12'\
|
898
|
+
'3321","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z","s'\
|
899
|
+
'alary":20000,"department":"Software Development","joiningDay":"Saturday","w'\
|
900
|
+
'orkingDays":["Monday","Tuesday","Friday"],"dependents":[{"name":"Future Wif'\
|
901
|
+
'e","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birthday":"'\
|
902
|
+
'1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Future Kid'\
|
903
|
+
'","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthday":"1'\
|
904
|
+
'994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Sun, 06 '\
|
905
|
+
'Nov 1994 08:49:37 GMT","promotedAt":1484719381},"dependents":[{"name":"Futu'\
|
906
|
+
're Wife","age":5147483649,"address":"H # 531, S # 20","uid":"123412","birth'\
|
907
|
+
'day":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"},{"name":"Futu'\
|
908
|
+
're Kid","age":5147483648,"address":"H # 531, S # 20","uid":"312341","birthd'\
|
909
|
+
'ay":"1994-02-13","birthtime":"1994-02-13T14:01:54.9571247Z"}],"hiredAt":"Su'\
|
910
|
+
'n, 06 Nov 1994 08:49:37 GMT"},{"name":"Shahid Khaliq","age":5147483645,"add'\
|
911
|
+
'ress":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":'\
|
912
|
+
'"1994-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Develo'\
|
913
|
+
'pment","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],'\
|
914
|
+
'"boss":{"personType":"Boss","name":"Zeeshan Ejaz","age":5147483645,"address'\
|
915
|
+
'":"H # 531, S # 20","uid":"123321","birthday":"1994-02-13","birthtime":"199'\
|
916
|
+
'4-02-13T14:01:54.9571247Z","salary":20000,"department":"Software Developmen'\
|
917
|
+
't","joiningDay":"Saturday","workingDays":["Monday","Tuesday","Friday"],"dep'\
|
918
|
+
'endents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, S # 20'\
|
919
|
+
'","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.9'\
|
920
|
+
'571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S # 20"'\
|
921
|
+
',"uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01:54.95'\
|
922
|
+
'71247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT","promotedAt":1484719381'\
|
923
|
+
'},"dependents":[{"name":"Future Wife","age":5147483649,"address":"H # 531, '\
|
924
|
+
'S # 20","uid":"123412","birthday":"1994-02-13","birthtime":"1994-02-13T14:0'\
|
925
|
+
'1:54.9571247Z"},{"name":"Future Kid","age":5147483648,"address":"H # 531, S'\
|
926
|
+
' # 20","uid":"312341","birthday":"1994-02-13","birthtime":"1994-02-13T14:01'\
|
927
|
+
':54.9571247Z"}],"hiredAt":"Sun, 06 Nov 1994 08:49:37 GMT"}]'
|
928
|
+
).map { |element| Employee.from_hash(element) }
|
929
|
+
|
930
|
+
# Perform the API call through the SDK function
|
931
|
+
result = self.class.controller.update_model_array(models)
|
932
|
+
|
933
|
+
# Test response code
|
934
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
935
|
+
|
936
|
+
# Test whether the captured response is as we expected
|
937
|
+
assert_not_nil(result)
|
938
|
+
expected_body = JSON.parse('{"passed":true}')
|
939
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
940
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
941
|
+
end
|
942
|
+
|
943
|
+
# Todo: Add description for test test_update_string_with_body_1
|
944
|
+
def test_update_string_with_body_1()
|
945
|
+
# Parameters for the API call
|
946
|
+
value = 'TestString'
|
947
|
+
|
948
|
+
# Perform the API call through the SDK function
|
949
|
+
result = self.class.controller.update_string_1(value)
|
950
|
+
|
951
|
+
# Test response code
|
952
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
953
|
+
|
954
|
+
# Test whether the captured response is as we expected
|
955
|
+
assert_not_nil(result)
|
956
|
+
expected_body = JSON.parse('{"passed":true}')
|
957
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
958
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
959
|
+
end
|
960
|
+
|
961
|
+
# Todo: Add description for test test_update_special_string_with_body_1
|
962
|
+
def test_update_special_string_with_body_1()
|
963
|
+
# Parameters for the API call
|
964
|
+
value = '$%^!@#$%^&*'
|
965
|
+
|
966
|
+
# Perform the API call through the SDK function
|
967
|
+
result = self.class.controller.update_string_1(value)
|
968
|
+
|
969
|
+
# Test response code
|
970
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
971
|
+
|
972
|
+
# Test whether the captured response is as we expected
|
973
|
+
assert_not_nil(result)
|
974
|
+
expected_body = JSON.parse('{"passed":true}')
|
975
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
976
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
977
|
+
end
|
978
|
+
|
979
|
+
# Todo: Add description for test test_update_multiliner_string_with_body_1
|
980
|
+
def test_update_multiliner_string_with_body_1()
|
981
|
+
# Parameters for the API call
|
982
|
+
value = 'TestString
|
983
|
+
nouman'
|
984
|
+
|
985
|
+
# Perform the API call through the SDK function
|
986
|
+
result = self.class.controller.update_string_1(value)
|
987
|
+
|
988
|
+
# Test response code
|
989
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
990
|
+
|
991
|
+
# Test whether the captured response is as we expected
|
992
|
+
assert_not_nil(result)
|
993
|
+
expected_body = JSON.parse('{"passed":true}')
|
994
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
995
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
996
|
+
end
|
997
|
+
|
998
|
+
# Todo: Add description for test test_update_string_with_body_corner_case_1
|
999
|
+
def test_update_string_with_body_corner_case_1()
|
1000
|
+
# Parameters for the API call
|
1001
|
+
value = ' '
|
1002
|
+
|
1003
|
+
# Perform the API call through the SDK function
|
1004
|
+
result = self.class.controller.update_string_1(value)
|
1005
|
+
|
1006
|
+
# Test response code
|
1007
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1008
|
+
|
1009
|
+
# Test whether the captured response is as we expected
|
1010
|
+
assert_not_nil(result)
|
1011
|
+
expected_body = JSON.parse('{"passed":true}')
|
1012
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1013
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1014
|
+
end
|
1015
|
+
|
1016
|
+
# Todo: Add description for test test_update_empty_string_with_body
|
1017
|
+
def test_update_empty_string_with_body()
|
1018
|
+
# Parameters for the API call
|
1019
|
+
value = ''
|
1020
|
+
|
1021
|
+
# Perform the API call through the SDK function
|
1022
|
+
assert_raise('APIException'){
|
1023
|
+
result = self.class.controller.update_string_1(value)
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
# Test response code
|
1027
|
+
assert_equal(@response_catcher.response.status_code, 400)
|
1028
|
+
end
|
1029
|
+
|
1030
|
+
# Todo: Add description for test test_update_string_array_with_body
|
1031
|
+
def test_update_string_array_with_body()
|
1032
|
+
# Parameters for the API call
|
1033
|
+
strings = JSON.parse('["abc","def"]')
|
1034
|
+
|
1035
|
+
# Perform the API call through the SDK function
|
1036
|
+
result = self.class.controller.update_string_array(strings)
|
1037
|
+
|
1038
|
+
# Test response code
|
1039
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1040
|
+
|
1041
|
+
# Test whether the captured response is as we expected
|
1042
|
+
assert_not_nil(result)
|
1043
|
+
expected_body = JSON.parse('{"passed":true}')
|
1044
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1045
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1046
|
+
end
|
1047
|
+
|
1048
|
+
# Todo: Add description for test test_send_string_with_new_line_1
|
1049
|
+
def test_send_string_with_new_line_1()
|
1050
|
+
# Parameters for the API call
|
1051
|
+
body = TestNstringEncoding.from_hash(JSON.parse('{"name":"farhan","field":"QA"}'))
|
1052
|
+
|
1053
|
+
# Perform the API call through the SDK function
|
1054
|
+
result = self.class.controller.send_string_with_new_line(body)
|
1055
|
+
|
1056
|
+
# Test response code
|
1057
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1058
|
+
|
1059
|
+
# Test whether the captured response is as we expected
|
1060
|
+
assert_not_nil(result)
|
1061
|
+
expected_body = JSON.parse('{"passed":true}')
|
1062
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1063
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1064
|
+
end
|
1065
|
+
|
1066
|
+
# Todo: Add description for test test_send_string_with_new_line_2
|
1067
|
+
def test_send_string_with_new_line_2()
|
1068
|
+
# Parameters for the API call
|
1069
|
+
body = TestNstringEncoding.from_hash(JSON.parse('{"name":"farhan","field":"QA&Dev"}'))
|
1070
|
+
|
1071
|
+
# Perform the API call through the SDK function
|
1072
|
+
result = self.class.controller.send_string_with_new_line(body)
|
1073
|
+
|
1074
|
+
# Test response code
|
1075
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1076
|
+
|
1077
|
+
# Test whether the captured response is as we expected
|
1078
|
+
assert_not_nil(result)
|
1079
|
+
expected_body = JSON.parse('{"passed":true}')
|
1080
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1081
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1082
|
+
end
|
1083
|
+
|
1084
|
+
# Todo: Add description for test test_send_string_with_new_line_3
|
1085
|
+
def test_send_string_with_new_line_3()
|
1086
|
+
# Parameters for the API call
|
1087
|
+
body = TestNstringEncoding.from_hash(JSON.parse('{"name":"farhan&nouman","field":"QA"}'))
|
1088
|
+
|
1089
|
+
# Perform the API call through the SDK function
|
1090
|
+
result = self.class.controller.send_string_with_new_line(body)
|
1091
|
+
|
1092
|
+
# Test response code
|
1093
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1094
|
+
|
1095
|
+
# Test whether the captured response is as we expected
|
1096
|
+
assert_not_nil(result)
|
1097
|
+
expected_body = JSON.parse('{"passed":true}')
|
1098
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1099
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1100
|
+
end
|
1101
|
+
|
1102
|
+
# Todo: Add description for test test_send_string_with_r_1
|
1103
|
+
def test_send_string_with_r_1()
|
1104
|
+
# Parameters for the API call
|
1105
|
+
body = TestRstringEncoding.from_hash(JSON.parse('{"name":"farhan","field":"QA"}'))
|
1106
|
+
|
1107
|
+
# Perform the API call through the SDK function
|
1108
|
+
result = self.class.controller.send_string_with_r(body)
|
1109
|
+
|
1110
|
+
# Test response code
|
1111
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1112
|
+
|
1113
|
+
# Test whether the captured response is as we expected
|
1114
|
+
assert_not_nil(result)
|
1115
|
+
expected_body = JSON.parse('{"passed":true}')
|
1116
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1117
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1118
|
+
end
|
1119
|
+
|
1120
|
+
# Todo: Add description for test test_send_string_with_r_2
|
1121
|
+
def test_send_string_with_r_2()
|
1122
|
+
# Parameters for the API call
|
1123
|
+
body = TestRstringEncoding.from_hash(JSON.parse('{"name":"farhan","field":"QA&Dev"}'))
|
1124
|
+
|
1125
|
+
# Perform the API call through the SDK function
|
1126
|
+
result = self.class.controller.send_string_with_r(body)
|
1127
|
+
|
1128
|
+
# Test response code
|
1129
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1130
|
+
|
1131
|
+
# Test whether the captured response is as we expected
|
1132
|
+
assert_not_nil(result)
|
1133
|
+
expected_body = JSON.parse('{"passed":true}')
|
1134
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1135
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1136
|
+
end
|
1137
|
+
|
1138
|
+
# Todo: Add description for test test_send_string_with_r_3
|
1139
|
+
def test_send_string_with_r_3()
|
1140
|
+
# Parameters for the API call
|
1141
|
+
body = TestRstringEncoding.from_hash(JSON.parse('{"name":"farhan&nouman","field":"QA"}'))
|
1142
|
+
|
1143
|
+
# Perform the API call through the SDK function
|
1144
|
+
result = self.class.controller.send_string_with_r(body)
|
1145
|
+
|
1146
|
+
# Test response code
|
1147
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1148
|
+
|
1149
|
+
# Test whether the captured response is as we expected
|
1150
|
+
assert_not_nil(result)
|
1151
|
+
expected_body = JSON.parse('{"passed":true}')
|
1152
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1153
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1154
|
+
end
|
1155
|
+
|
1156
|
+
# Todo: Add description for test test_send_string_in_body_with_r_n_1
|
1157
|
+
def test_send_string_in_body_with_r_n_1()
|
1158
|
+
# Parameters for the API call
|
1159
|
+
body = TestRNstringEncoding.from_hash(JSON.parse('{"name":"farhan","field":"QA"}'))
|
1160
|
+
|
1161
|
+
# Perform the API call through the SDK function
|
1162
|
+
result = self.class.controller.send_string_in_body_with_r_n(body)
|
1163
|
+
|
1164
|
+
# Test response code
|
1165
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1166
|
+
|
1167
|
+
# Test whether the captured response is as we expected
|
1168
|
+
assert_not_nil(result)
|
1169
|
+
expected_body = JSON.parse('{"passed":true}')
|
1170
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1171
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1172
|
+
end
|
1173
|
+
|
1174
|
+
# Todo: Add description for test test_send_string_in_body_with_r_n_2
|
1175
|
+
def test_send_string_in_body_with_r_n_2()
|
1176
|
+
# Parameters for the API call
|
1177
|
+
body = TestRNstringEncoding.from_hash(JSON.parse('{"name":"farhan","field":"QA&Dev"}'))
|
1178
|
+
|
1179
|
+
# Perform the API call through the SDK function
|
1180
|
+
result = self.class.controller.send_string_in_body_with_r_n(body)
|
1181
|
+
|
1182
|
+
# Test response code
|
1183
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1184
|
+
|
1185
|
+
# Test whether the captured response is as we expected
|
1186
|
+
assert_not_nil(result)
|
1187
|
+
expected_body = JSON.parse('{"passed":true}')
|
1188
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1189
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1190
|
+
end
|
1191
|
+
|
1192
|
+
# Todo: Add description for test test_send_string_in_body_with_r_n_3
|
1193
|
+
def test_send_string_in_body_with_r_n_3()
|
1194
|
+
# Parameters for the API call
|
1195
|
+
body = TestRNstringEncoding.from_hash(JSON.parse('{"name":"farhan&nouman","field":"QA"}'))
|
1196
|
+
|
1197
|
+
# Perform the API call through the SDK function
|
1198
|
+
result = self.class.controller.send_string_in_body_with_r_n(body)
|
1199
|
+
|
1200
|
+
# Test response code
|
1201
|
+
assert_equal(@response_catcher.response.status_code, 200)
|
1202
|
+
|
1203
|
+
# Test whether the captured response is as we expected
|
1204
|
+
assert_not_nil(result)
|
1205
|
+
expected_body = JSON.parse('{"passed":true}')
|
1206
|
+
received_body = JSON.parse(@response_catcher.response.raw_body)
|
1207
|
+
assert(TestHelper.match_body(expected_body, received_body, check_values: true))
|
1208
|
+
end
|
1209
|
+
|
1210
|
+
end
|