soaspec 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +15 -15
  3. data/.gitlab-ci.yml +31 -31
  4. data/.rspec +3 -3
  5. data/.rubocop.yml +2 -2
  6. data/CODE_OF_CONDUCT.md +74 -74
  7. data/ChangeLog +384 -380
  8. data/Gemfile +6 -6
  9. data/LICENSE.txt +21 -21
  10. data/README.md +85 -85
  11. data/Rakefile +24 -24
  12. data/Todo.md +6 -6
  13. data/exe/soaspec +119 -119
  14. data/exe/soaspec-virtual-server +103 -103
  15. data/exe/xml_to_yaml_file +60 -60
  16. data/lib/soaspec.rb +91 -80
  17. data/lib/soaspec/core_ext/hash.rb +83 -83
  18. data/lib/soaspec/exchange.rb +234 -234
  19. data/lib/soaspec/exchange_handlers/exchange_handler.rb +103 -103
  20. data/lib/soaspec/exchange_handlers/handler_accessors.rb +106 -106
  21. data/lib/soaspec/exchange_handlers/rest_accessors.rb +92 -92
  22. data/lib/soaspec/exchange_handlers/rest_handler.rb +311 -311
  23. data/lib/soaspec/exchange_handlers/rest_methods.rb +44 -44
  24. data/lib/soaspec/exchange_handlers/soap_handler.rb +236 -236
  25. data/lib/soaspec/exe_helpers.rb +56 -56
  26. data/lib/soaspec/generator/.rspec.erb +5 -5
  27. data/lib/soaspec/generator/.travis.yml.erb +5 -5
  28. data/lib/soaspec/generator/Gemfile.erb +8 -8
  29. data/lib/soaspec/generator/README.md.erb +29 -29
  30. data/lib/soaspec/generator/Rakefile.erb +19 -19
  31. data/lib/soaspec/generator/config/data/default.yml.erb +1 -1
  32. data/lib/soaspec/generator/lib/blz_service.rb.erb +26 -26
  33. data/lib/soaspec/generator/lib/dynamic_class_content.rb.erb +12 -12
  34. data/lib/soaspec/generator/lib/shared_example.rb.erb +8 -8
  35. data/lib/soaspec/generator/spec/dynamic_soap_spec.rb.erb +12 -12
  36. data/lib/soaspec/generator/spec/soap_spec.rb.erb +51 -51
  37. data/lib/soaspec/generator/spec/spec_helper.rb.erb +20 -20
  38. data/lib/soaspec/generator/template/soap_template.xml +6 -6
  39. data/lib/soaspec/interpreter.rb +40 -40
  40. data/lib/soaspec/matchers.rb +65 -65
  41. data/lib/soaspec/not_found_errors.rb +13 -13
  42. data/lib/soaspec/soaspec_shared_examples.rb +24 -24
  43. data/lib/soaspec/spec_logger.rb +27 -27
  44. data/lib/soaspec/test_server/bank.wsdl +90 -90
  45. data/lib/soaspec/test_server/get_bank.rb +160 -160
  46. data/lib/soaspec/test_server/invoices.rb +27 -27
  47. data/lib/soaspec/test_server/namespace.xml +14 -14
  48. data/lib/soaspec/test_server/note.xml +5 -5
  49. data/lib/soaspec/test_server/puppy_service.rb +20 -20
  50. data/lib/soaspec/test_server/test_attribute.rb +13 -13
  51. data/lib/soaspec/version.rb +2 -2
  52. data/lib/soaspec/wsdl_generator.rb +144 -144
  53. data/soaspec.gemspec +45 -45
  54. data/test.wsdl +116 -116
  55. data/test.xml +10 -10
  56. data/test_wsdl.rb +43 -43
  57. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 47048ecb768673e682744c8ed3064450530ed0de
4
- data.tar.gz: 4f4137848f7a656914205ad76a3ae800a065c969
2
+ SHA256:
3
+ metadata.gz: b992b8fa5a81841d85c8ab8e1d5e82949f9338ef9e22a5fd77e5c19a58571870
4
+ data.tar.gz: 22521f0f2f412410fc3f35829828edca46634b1b20fb48e7356591adafe13af0
5
5
  SHA512:
6
- metadata.gz: dd35e76ceae861c08bcad153b0e124643c83b856071e486116f40d1a7c210f92b4d0854172bcf14a5d1a462e42f5ad197fd8853bdd8a252bbfc469948c52a1d9
7
- data.tar.gz: 167dbbf4db1b4a61def28a6c4bfea8810c192a922f03495ae727fc754b9086a0658e8e5b1c4a0265a7d5c2ae322207f65889d65d4096a3061b7a7cb20e6886fb
6
+ metadata.gz: 4adb0506d6ad7ff2af07c3ca501b156a05f4ce7d76992e1b2875bf977d58d620294760dfd8d7474a0cad57f3d6b0d656fbd83c5331f8cd8760b2399609ef0b4b
7
+ data.tar.gz: a08ce8e6eeae9151265992a5f9a02213cfc1910d2920a46a458cbbb995f438269704c489feed8170efc4c91fa91cd99cbd14c084f9a86ccd364b3bbac2c4798c
data/.gitignore CHANGED
@@ -1,15 +1,15 @@
1
- /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
- /coverage/
5
- /doc/
6
- /logs/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- /.idea/
11
- Gemfile.lock
12
- coverage
13
-
14
- # rspec failure tracking
15
- .rspec_status
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /logs/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /.idea/
11
+ Gemfile.lock
12
+ coverage
13
+
14
+ # rspec failure tracking
15
+ .rspec_status
@@ -1,32 +1,32 @@
1
- before_script:
2
- - apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
3
- - ruby -v
4
- - which ruby
5
- - gem install bundler rake --no-ri --no-rdoc
6
- - bundle install --jobs $(nproc) "${FLAGS[@]}"
7
-
8
- rspec:
9
- stage: test
10
- script:
11
- - bundle exec rake spec
12
- artifacts:
13
- paths:
14
- - coverage/
15
-
16
- cucumber:
17
- stage: test
18
- script:
19
- - bundle exec cucumber
20
-
21
- pages:
22
- stage: deploy
23
- dependencies:
24
- - rspec
25
- script:
26
- - mv coverage/ public/
27
- artifacts:
28
- paths:
29
- - public
30
- expire_in: 30 days
31
- only:
1
+ before_script:
2
+ - apt-get update -qq && apt-get install -y -qq sqlite3 libsqlite3-dev nodejs
3
+ - ruby -v
4
+ - which ruby
5
+ - gem install bundler rake --no-ri --no-rdoc
6
+ - bundle install --jobs $(nproc) "${FLAGS[@]}"
7
+
8
+ rspec:
9
+ stage: test
10
+ script:
11
+ - bundle exec rake spec
12
+ artifacts:
13
+ paths:
14
+ - coverage/
15
+
16
+ cucumber:
17
+ stage: test
18
+ script:
19
+ - bundle exec cucumber
20
+
21
+ pages:
22
+ stage: deploy
23
+ dependencies:
24
+ - rspec
25
+ script:
26
+ - mv coverage/ public/
27
+ artifacts:
28
+ paths:
29
+ - public
30
+ expire_in: 30 days
31
+ only:
32
32
  - master
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --require spec_helper
2
- --format documentation
3
- --color
1
+ --require spec_helper
2
+ --format documentation
3
+ --color
@@ -1,2 +1,2 @@
1
- Metrics/LineLength:
2
- Max: 154
1
+ Metrics/LineLength:
2
+ Max: 154
@@ -1,74 +1,74 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- In the interest of fostering an open and welcoming environment, we as
6
- contributors and maintainers pledge to making participation in our project and
7
- our community a harassment-free experience for everyone, regardless of age, body
8
- size, disability, ethnicity, gender identity and expression, level of experience,
9
- nationality, personal appearance, race, religion, or sexual identity and
10
- orientation.
11
-
12
- ## Our Standards
13
-
14
- Examples of behavior that contributes to creating a positive environment
15
- include:
16
-
17
- * Using welcoming and inclusive language
18
- * Being respectful of differing viewpoints and experiences
19
- * Gracefully accepting constructive criticism
20
- * Focusing on what is best for the community
21
- * Showing empathy towards other community members
22
-
23
- Examples of unacceptable behavior by participants include:
24
-
25
- * The use of sexualized language or imagery and unwelcome sexual attention or
26
- advances
27
- * Trolling, insulting/derogatory comments, and personal or political attacks
28
- * Public or private harassment
29
- * Publishing others' private information, such as a physical or electronic
30
- address, without explicit permission
31
- * Other conduct which could reasonably be considered inappropriate in a
32
- professional setting
33
-
34
- ## Our Responsibilities
35
-
36
- Project maintainers are responsible for clarifying the standards of acceptable
37
- behavior and are expected to take appropriate and fair corrective action in
38
- response to any instances of unacceptable behavior.
39
-
40
- Project maintainers have the right and responsibility to remove, edit, or
41
- reject comments, commits, code, wiki edits, issues, and other contributions
42
- that are not aligned to this Code of Conduct, or to ban temporarily or
43
- permanently any contributor for other behaviors that they deem inappropriate,
44
- threatening, offensive, or harmful.
45
-
46
- ## Scope
47
-
48
- This Code of Conduct applies both within project spaces and in public spaces
49
- when an individual is representing the project or its community. Examples of
50
- representing a project or community include using an official project e-mail
51
- address, posting via an official social media account, or acting as an appointed
52
- representative at an online or offline event. Representation of a project may be
53
- further defined and clarified by project maintainers.
54
-
55
- ## Enforcement
56
-
57
- Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project team at samuel.garratt@integrationqa.com. All
59
- complaints will be reviewed and investigated and will result in a response that
60
- is deemed necessary and appropriate to the circumstances. The project team is
61
- obligated to maintain confidentiality with regard to the reporter of an incident.
62
- Further details of specific enforcement policies may be posted separately.
63
-
64
- Project maintainers who do not follow or enforce the Code of Conduct in good
65
- faith may face temporary or permanent repercussions as determined by other
66
- members of the project's leadership.
67
-
68
- ## Attribution
69
-
70
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
- available at [http://contributor-covenant.org/version/1/4][version]
72
-
73
- [homepage]: http://contributor-covenant.org
74
- [version]: http://contributor-covenant.org/version/1/4/
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at samuel.garratt@integrationqa.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/ChangeLog CHANGED
@@ -1,381 +1,385 @@
1
- Version 0.1.0
2
- * Enhancements
3
- * Cleaned up unit tests for WSDL generator. Won't bother for SOAP ComplexType for now as I'm not needing this and it looks like Savon 3 will create example requests anyway
4
- * Put SOAP Basic Auth in Example
5
- * Added template handling for REST handler
6
-
7
- Version 0.0.89
8
- * Enhancements
9
- * Move more functionality out of soaspec exe and into WsdlGenerator. Started unit tests for it
10
-
11
- Version 0.0.88
12
- * Bug Fix
13
- * Corrected '_format' variable name that was breaking failing to find rest element
14
-
15
- Version 0.0.87
16
- * Bug Fix
17
- * Fixed incorrect logging for when 'debug_oauth' is off
18
-
19
- Version 0.0.86
20
- * Enhancements
21
- * 'debug_oauth' attribute used to toggle showing params used in retrieving access token
22
-
23
- Version 0.0.85
24
- * Enhancements
25
- * Interpret XML and JSON better so that JSON with XML in it's tags is catered for
26
-
27
- Version 0.0.84
28
- * Enhancements
29
- * 'strip_namespaces' defined in exchange handlers not globally which makes more sense
30
- * Created 'to_hash' method for Exchange that returns a Hash of XML or JSON response (primarily for REST)
31
-
32
- Version 0.0.83
33
- * Enhancements
34
- * Handle BOM or other characters that could be at start of xml of json response string
35
-
36
- Version 0.0.82
37
- * Enhancements
38
- * Fixed namespace handling for REST
39
-
40
- Version 0.0.81
41
- * Enhancements
42
- * SoapHandler - define exchange method for each SOAP operation. See `one_off_spec` for example
43
-
44
- Version 0.0.80
45
- * Enhancements
46
- * `values_from_path` method on `RestHandler` to easily extract multiple values for an xpath or json path
47
- * Bug fix
48
- * Support response that has white space surrounding message
49
-
50
- Version 0.0.79
51
- * Enhancements
52
- * `values_from_path` method on `SoapHandler` to easily extract multiple values for an xpath
53
- * If `id` is specified on associated factory, FactoryBot will populate the primary factory with that id. See `rest/factory_spec` for eg
54
-
55
- Version 0.0.78
56
- * Enhancements
57
- * Use 'thor' for `soaspec generate`, allowing less prompt and more options through command line. Added tests for it
58
-
59
- Version 0.0.77
60
- * Enhancements
61
- * Use 'thor' for soaspec-init binary changing it to be `soaspec init`. Will update `soaspec-generate` in next version
62
- * Put pause of 1/2 a second for each API retry. Often retry is too quick otherwise
63
-
64
- Version 0.0.76
65
- * Bug fix
66
- * Fixed BLZService scenario on soaspec-virtual-server
67
- * Fixed return value for retry_for_success failure
68
- * Enhancements
69
- * Added method to indicate a factory create should actually return a failure status
70
-
71
- Version 0.0.75
72
- * Enhancements
73
- * For Factory created methods, set retry_for_success to true. Allow for this to be set at Exchange class level
74
-
75
- Version 0.0.74
76
- * Enhancements
77
- * RestHandler, enable api username to be set upon initialisation
78
-
79
- Version 0.0.73
80
- * Enhancements
81
- * Added 'default_handler' method with which define an exchange_handler to be created when an exchange is initialized
82
- * Refactoring
83
- * Use `@exchange_handler` instead of `@api_class` which is more consistent
84
-
85
- Version 0.0.72
86
- * Enhancements
87
- * Add ability to convert XML response to lower case for simpler xpath searching
88
-
89
- Version 0.0.71
90
- * Bug fix
91
- * Got exe 'soaspec-virtual-server' working
92
-
93
- Version 0.0.70
94
- * Enhancements
95
- * Added api_username method to REST handler to change user for an API during runtime
96
-
97
- Version 0.0.69
98
- * Enhancements
99
- * Calculate base_url ERB at time of handler's first request (Rather than when initialised).
100
- - Important for where base url uses ERB and so does oauth whose user may change
101
- * Demonstrate using oauth via spec
102
- * Demonstrate using basic auth via spec
103
-
104
- Version 0.0.68
105
- * Enhancements
106
- * Use ERB to calculate base_url for dynamic bases
107
-
108
- Version 0.0.67
109
- * Enhancements
110
- * Handle scenario where Request key is unconventional and not PascalCase key snakecase convert would break it
111
- - if first character of key is captial, PascalCase conversion is ignored
112
-
113
- Version 0.0.66
114
- * Enhancements
115
- * Added method to convert REST request keys to 'PascalCase' if 'pascal_keys' is set to true
116
- * This also converts paths obtaining elements to 'PascalCase' if they're simple and have no starting '//' or '$..'
117
-
118
- Version 0.0.65
119
- * Enhancements
120
- * Added ability to set 'suburl' and 'method' in Exchange accessor. Will be used in FactoryBot later
121
-
122
- Version 0.0.64
123
- * Enhancements
124
- * Got FactoryBot working for RestHandler. See specs for example
125
- * Add element? method to exchange to make it easier to check element is at path
126
- * Define 'element_name?' created when element is defined on ExchangeHandler
127
-
128
- Version 0.0.63
129
- * Enhancements
130
- * Interpret ERB for oauth credentials within oauth response. Needed for when params like 'username' can change in runtime
131
-
132
- Version 0.0.62
133
- * Enhancements
134
- * Use q parameter to simply to query parameters on REST requests
135
-
136
- Version 0.0.61
137
- * Enhancements
138
- * Retrieving oauth response try 3 times (to bypass intermittent errors)
139
-
140
- Version 0.0.60
141
- * Enhancements
142
- * Allow for factory_bot with automatic setting of missing setter methods
143
-
144
- Version 0.0.59
145
- * Enhancements
146
- * Perform ERB in headers to make using access_token using 'headers' possible
147
- * Try better way of testing `soaspec-init`.
148
-
149
- Version 0.0.58
150
- * Enhancements
151
- * Add method to set parts of the request body through `exchange[key]= 'value'`
152
- * Added example of Cucumber feature demonstrating this
153
-
154
- Version 0.0.56
155
- * Bug fix
156
- * Handle creating of traffic.log file within lib properly
157
-
158
- Version 0.0.55
159
- * Enhancements
160
- * Made `soaspec-virtual-server` exe to handle self served test server. Will be used in wiki tutorial
161
-
162
- Version 0.0.54
163
- * Enhancements
164
- * Make 'headers' accessor for setting headers on RestHandler easier
165
-
166
- Version 0.0.53
167
- * Enhancements
168
- * Make attribute possible for REST methods as well (as they can use XML too)
169
- * For non XML, non JSON responses, handle with regex or key for a Hash
170
-
171
- Version 0.0.52
172
- * Enhancements
173
- * Now have 'attribute' accessor making it easy to access an attribute from a response
174
-
175
- Version 0.0.51
176
- * Enhancements
177
- * Allow for 'default_hash=' method to be used in RestHandler. See 'many_calls_one_method_spec' for example
178
- * Got 'element' accessor working correctly (See soap/hash_spec.rb + 'blz_service' for example)
179
-
180
- Version 0.0.50
181
- * Enhancements
182
- * Able to use ERB in oauth parameters and extract oauth hash with 'oauth_response' method defined by 'oauth_file'
183
-
184
- Version 0.0.47
185
- * Bug Fix
186
- * Using 'Strip namespace' handle both namespace or not dependent if used
187
-
188
- Version 0.0.47
189
- * Enhancements
190
- * 'success scenarios' shared eg and 'retry_for_success' exchange method's status codes include 200..299, not just 200.
191
-
192
- Version 0.0.46
193
- * Enhancements
194
- * 'include_key?' method use 'value_from_path'. Iterating through Hashes with 'include_key?' wouldn't work as expected with some JSON bodies with my current implementation
195
-
196
- Version 0.0.45
197
- * Enhancements
198
- * No need to use 'name' when creating SoapHandler and RestHandler. Default is ClassName
199
-
200
- Version 0.0.44
201
- * Enhancements
202
- * Test Server log to logs/test_server.log
203
- * Simplify ExchangeHandler storing and retrieving values (see soap/hash_spec.rb)
204
- * Make setting SoapHandler operation and other params possible through object instantiation. Less code needed
205
-
206
- Version 0.0.43
207
- * Bug fix
208
- * Remove Environment namespace from 'soaspec-generate'
209
- * Enhancements
210
- * Convenience methods for REST calls in which you can call something like 'ClassInheritingRestHandler.get(params)' See 'spec/soaspec/rest/one_off_spec.rb' for details
211
-
212
- Version 0.0.42
213
- * Enhancements
214
- * Set Soaspec.api_handler work class is created. No need to call '.to_s' method
215
-
216
- Version 0.0.41
217
- * Bug fix
218
- * soaspec-generate not designed to work with virtual service. Rakefile not try to set that up
219
-
220
- Version 0.0.40
221
- * Enhancements
222
- * soaspec-generate now handle a wsdl without parameters in the operation and rather look up input element type
223
- * test_server virtual service now handle scenario where bank is not found and test made for that
224
-
225
- Version 0.0.39
226
- * Spec
227
- * Create task to use soaspec-init to create test structure and test it.
228
- * Enhancements
229
- * Take away need to use Environment namespace
230
- * Added response headers to REST response log
231
- * Now using virtual Web Service for SOAP
232
-
233
- Version 0.0.38
234
- * Bug fix
235
- * Fixed error in soaspec-generate. TODO: Test this in CI
236
-
237
- Version 0.0.37 / 2018-3-16
238
- * Enhancements
239
- * Made retry_for_success method to keep making request until 200 status code if set on exchange
240
- * If '$' not included for json_path, by default a '$..' is added for convenience
241
-
242
- Version 0.0.36 / 2018-3-15
243
- * Bug fix
244
- * Make test name log in correct place
245
- * Enhancements
246
- * Made accessor 'mandatory_json_values' to make it easier to share mandatory json path - value pairs
247
- * Created 'store' method for handler through which one can store a value and use it later on it in the same context
248
- * Deprecated
249
- * Removed old 'mandatory_elements', 'mandatory_xpath_values' overridden way of handling data for favor of new way of it setting 'expected_mandatory_elements'
250
-
251
- Version 0.0.35 / 2018-3-13
252
- * Enhancements
253
- * Handle array of JSON hashes starting with '['
254
- * Handle patch and put methods with data for REST
255
-
256
- Version 0.0.34 / 2018-3-12
257
- * Enhancements
258
- * Add oauth2 and oauth2_file methods to make it easy to load oauth2 parameters. Still a work in progress to handle all oauth2 variations
259
-
260
- Version 0.0.33 / 2018-3-9
261
- * Enhancements
262
- * Use 'jsonpath' instead of dig to check JSON responses. Much better for finding complex paths
263
-
264
- Version 0.0.32 / 2018-3-9
265
- * Enhancements
266
- * Made :body key in hash that can be used to use JSON.generate for a payload when using rest_handler exchanges
267
-
268
- Version 0.0.31 / 2018-3-8
269
- * Enhancements
270
- * Compacted unit tests for exchange handler
271
- * Implemented include_key? and find via xpath for REST handler. See specs
272
-
273
- Version 0.0.30 / 2018-3-6
274
- * Bug fix
275
- * Made generated class file name in soaspec-generate snakecase (was CamelCase)
276
-
277
- Version 0.0.29 / 2018-3-6
278
- * Refactorings
279
- * Base 'test' class from 'Tester' to 'ExhangeHandler'
280
- * Made default Soap Handler class 'SoapHandler' and making use of 'BasicSoapHandler' deprecated
281
-
282
- Version 0.0.28 / 2018-3-6
283
- * Enhancements
284
- * Added not_found matcher and used in spec example
285
- * Only call request upon first need of an Exchange response. This means test request is made as part of 'it' rather than in describe
286
-
287
- Version 0.0.27 / 2018-3-5
288
- * Bug fix
289
- * Fixed log file not present error
290
- * Updated exe binaries to use latest format
291
-
292
- Version 0.0.26 / 2018-3-5
293
- * Refactorings
294
- * Using methods to define mandatory_elements, mandatory_xpath_values, root_attributes, base_url. Please see specs. This is shorter to type and clearer
295
-
296
- Version 0.0.25 / 2018-2-25
297
- * Enhancements
298
- * Updated rest_handler to convert JSON and XML into Hash and use it in 'contain_value'. This still needs work.
299
- * Showed example of workflow using 'pet' url
300
-
301
- Version 0.0.24 / 2018-2-25
302
- * Enhancements
303
- * Added to soaspec-generate more types when creating YAML with data (int, boolean, double and custom enumeration).
304
- * Binaries use common module (exe-helper) to reduce repeatability
305
- * TODO: soaspec-generate read xsd's mentioned to import in WSDL schema
306
-
307
- Version 0.0.23 / 2018-2-23
308
- * Enhancements
309
- * Created RestHandler class (Very messy and ugly still) to handle REST requests using style used for SOAP using Rest Client resource
310
-
311
- Version 0.0.22 / 2018-2-15
312
- * Enhancements
313
- * Created new 'include_in_body' matcher to find value anywhere in response body (which could be a substring of an element)
314
-
315
- Version 0.0.21 / 2018-1-29
316
- * Enhancements
317
- * Added soaspec-generate - still in POC mode to generate files from a WSDL.
318
- * Added test_wsdl to start at validating xml according to WSDL. Still needs polishing
319
-
320
- Version 0.0.20 / 2018-1-26
321
- * Enhancements
322
- * Added ability to strip namespaces 'Soaspec::Environment.strip_namespaces = true'. See spec for example
323
- * Fixes
324
- * Made custom error and used it to make 'have_element_at_xpath' work when negated
325
-
326
- Version 0.0.19 / 2018-1-25
327
- * Enhancements
328
- * Added own shared examples to init script and to in built specs
329
-
330
- Version 0.0.18 / 2018-1-25
331
- * Fixes
332
- * Updated 'soaspec-init' so that it works again.
333
- * Enhancements
334
- * Added example showing representing data for request in YAML
335
-
336
- Version 0.0.17 / 2018-1-25
337
- * Fixes
338
- * Updated hash search so that it handles Array
339
-
340
- Version 0.0.16 / 2018-1-23
341
- * Fixes
342
- * Corrected logic of auto convert to hash. Previous version did not handle test specific values correctly
343
-
344
- Version 0.0.15 / 2018-1-23
345
- * Fixes
346
- * Updated code to convert string key in Savon request to key automatically by default before passing to Savon. This saves
347
- the user doing the conversion themselves.
348
-
349
- Version 0.0.14 / 2018-1-23
350
- * Fixes
351
- * Updated 'xml_to_yaml_file' exe to clean up YAML more. No more array for Hash value. Indenting needs work though.
352
- Now it's more like something you can read and pass into Savon request.
353
-
354
- Version 0.0.13 / 2018-1-23
355
- * Enhancements
356
- * Executable to create xml file from yaml
357
-
358
- Version 0.0.12 / 2018/1-22
359
- * Enhancements
360
- * Example name added to log file
361
-
362
- Version 0.0.10 / 2018-1-21
363
- * Enhancements
364
- * Added [] method to perform xpath assertion
365
- * Using Savon xpath. No need to explicitly provide namespace for xpath
366
-
367
- Version 0.0.9 / 2018-1-20
368
- * Refactoring
369
- * class_options -> savon_options - More specific
370
- * default_operation -> operation - Not default anymore so better not in name
371
- * Enhancements
372
- * Made mandatory_xpath_values method to add to 'success scenarios' shared example
373
-
374
- Version 0.0.8 / 2018-1-19
375
- * Enhancements
376
- * Added root_attributes method to add attribute to the root class
377
-
378
- Version 0.0.7 / 2018-1-19
379
- * Enhancements
380
- * Added contain_key matcher
1
+ Version 0.1.1
2
+ * Enhancements
3
+ * Added ability to turn off logs (helpful if making a lot of API calls)
4
+
5
+ Version 0.1.0
6
+ * Enhancements
7
+ * Cleaned up unit tests for WSDL generator. Won't bother for SOAP ComplexType for now as I'm not needing this and it looks like Savon 3 will create example requests anyway
8
+ * Put SOAP Basic Auth in Example
9
+ * Added template handling for REST handler
10
+
11
+ Version 0.0.89
12
+ * Enhancements
13
+ * Move more functionality out of soaspec exe and into WsdlGenerator. Started unit tests for it
14
+
15
+ Version 0.0.88
16
+ * Bug Fix
17
+ * Corrected '_format' variable name that was breaking failing to find rest element
18
+
19
+ Version 0.0.87
20
+ * Bug Fix
21
+ * Fixed incorrect logging for when 'debug_oauth' is off
22
+
23
+ Version 0.0.86
24
+ * Enhancements
25
+ * 'debug_oauth' attribute used to toggle showing params used in retrieving access token
26
+
27
+ Version 0.0.85
28
+ * Enhancements
29
+ * Interpret XML and JSON better so that JSON with XML in it's tags is catered for
30
+
31
+ Version 0.0.84
32
+ * Enhancements
33
+ * 'strip_namespaces' defined in exchange handlers not globally which makes more sense
34
+ * Created 'to_hash' method for Exchange that returns a Hash of XML or JSON response (primarily for REST)
35
+
36
+ Version 0.0.83
37
+ * Enhancements
38
+ * Handle BOM or other characters that could be at start of xml of json response string
39
+
40
+ Version 0.0.82
41
+ * Enhancements
42
+ * Fixed namespace handling for REST
43
+
44
+ Version 0.0.81
45
+ * Enhancements
46
+ * SoapHandler - define exchange method for each SOAP operation. See `one_off_spec` for example
47
+
48
+ Version 0.0.80
49
+ * Enhancements
50
+ * `values_from_path` method on `RestHandler` to easily extract multiple values for an xpath or json path
51
+ * Bug fix
52
+ * Support response that has white space surrounding message
53
+
54
+ Version 0.0.79
55
+ * Enhancements
56
+ * `values_from_path` method on `SoapHandler` to easily extract multiple values for an xpath
57
+ * If `id` is specified on associated factory, FactoryBot will populate the primary factory with that id. See `rest/factory_spec` for eg
58
+
59
+ Version 0.0.78
60
+ * Enhancements
61
+ * Use 'thor' for `soaspec generate`, allowing less prompt and more options through command line. Added tests for it
62
+
63
+ Version 0.0.77
64
+ * Enhancements
65
+ * Use 'thor' for soaspec-init binary changing it to be `soaspec init`. Will update `soaspec-generate` in next version
66
+ * Put pause of 1/2 a second for each API retry. Often retry is too quick otherwise
67
+
68
+ Version 0.0.76
69
+ * Bug fix
70
+ * Fixed BLZService scenario on soaspec-virtual-server
71
+ * Fixed return value for retry_for_success failure
72
+ * Enhancements
73
+ * Added method to indicate a factory create should actually return a failure status
74
+
75
+ Version 0.0.75
76
+ * Enhancements
77
+ * For Factory created methods, set retry_for_success to true. Allow for this to be set at Exchange class level
78
+
79
+ Version 0.0.74
80
+ * Enhancements
81
+ * RestHandler, enable api username to be set upon initialisation
82
+
83
+ Version 0.0.73
84
+ * Enhancements
85
+ * Added 'default_handler' method with which define an exchange_handler to be created when an exchange is initialized
86
+ * Refactoring
87
+ * Use `@exchange_handler` instead of `@api_class` which is more consistent
88
+
89
+ Version 0.0.72
90
+ * Enhancements
91
+ * Add ability to convert XML response to lower case for simpler xpath searching
92
+
93
+ Version 0.0.71
94
+ * Bug fix
95
+ * Got exe 'soaspec-virtual-server' working
96
+
97
+ Version 0.0.70
98
+ * Enhancements
99
+ * Added api_username method to REST handler to change user for an API during runtime
100
+
101
+ Version 0.0.69
102
+ * Enhancements
103
+ * Calculate base_url ERB at time of handler's first request (Rather than when initialised).
104
+ - Important for where base url uses ERB and so does oauth whose user may change
105
+ * Demonstrate using oauth via spec
106
+ * Demonstrate using basic auth via spec
107
+
108
+ Version 0.0.68
109
+ * Enhancements
110
+ * Use ERB to calculate base_url for dynamic bases
111
+
112
+ Version 0.0.67
113
+ * Enhancements
114
+ * Handle scenario where Request key is unconventional and not PascalCase key snakecase convert would break it
115
+ - if first character of key is captial, PascalCase conversion is ignored
116
+
117
+ Version 0.0.66
118
+ * Enhancements
119
+ * Added method to convert REST request keys to 'PascalCase' if 'pascal_keys' is set to true
120
+ * This also converts paths obtaining elements to 'PascalCase' if they're simple and have no starting '//' or '$..'
121
+
122
+ Version 0.0.65
123
+ * Enhancements
124
+ * Added ability to set 'suburl' and 'method' in Exchange accessor. Will be used in FactoryBot later
125
+
126
+ Version 0.0.64
127
+ * Enhancements
128
+ * Got FactoryBot working for RestHandler. See specs for example
129
+ * Add element? method to exchange to make it easier to check element is at path
130
+ * Define 'element_name?' created when element is defined on ExchangeHandler
131
+
132
+ Version 0.0.63
133
+ * Enhancements
134
+ * Interpret ERB for oauth credentials within oauth response. Needed for when params like 'username' can change in runtime
135
+
136
+ Version 0.0.62
137
+ * Enhancements
138
+ * Use q parameter to simply to query parameters on REST requests
139
+
140
+ Version 0.0.61
141
+ * Enhancements
142
+ * Retrieving oauth response try 3 times (to bypass intermittent errors)
143
+
144
+ Version 0.0.60
145
+ * Enhancements
146
+ * Allow for factory_bot with automatic setting of missing setter methods
147
+
148
+ Version 0.0.59
149
+ * Enhancements
150
+ * Perform ERB in headers to make using access_token using 'headers' possible
151
+ * Try better way of testing `soaspec-init`.
152
+
153
+ Version 0.0.58
154
+ * Enhancements
155
+ * Add method to set parts of the request body through `exchange[key]= 'value'`
156
+ * Added example of Cucumber feature demonstrating this
157
+
158
+ Version 0.0.56
159
+ * Bug fix
160
+ * Handle creating of traffic.log file within lib properly
161
+
162
+ Version 0.0.55
163
+ * Enhancements
164
+ * Made `soaspec-virtual-server` exe to handle self served test server. Will be used in wiki tutorial
165
+
166
+ Version 0.0.54
167
+ * Enhancements
168
+ * Make 'headers' accessor for setting headers on RestHandler easier
169
+
170
+ Version 0.0.53
171
+ * Enhancements
172
+ * Make attribute possible for REST methods as well (as they can use XML too)
173
+ * For non XML, non JSON responses, handle with regex or key for a Hash
174
+
175
+ Version 0.0.52
176
+ * Enhancements
177
+ * Now have 'attribute' accessor making it easy to access an attribute from a response
178
+
179
+ Version 0.0.51
180
+ * Enhancements
181
+ * Allow for 'default_hash=' method to be used in RestHandler. See 'many_calls_one_method_spec' for example
182
+ * Got 'element' accessor working correctly (See soap/hash_spec.rb + 'blz_service' for example)
183
+
184
+ Version 0.0.50
185
+ * Enhancements
186
+ * Able to use ERB in oauth parameters and extract oauth hash with 'oauth_response' method defined by 'oauth_file'
187
+
188
+ Version 0.0.47
189
+ * Bug Fix
190
+ * Using 'Strip namespace' handle both namespace or not dependent if used
191
+
192
+ Version 0.0.47
193
+ * Enhancements
194
+ * 'success scenarios' shared eg and 'retry_for_success' exchange method's status codes include 200..299, not just 200.
195
+
196
+ Version 0.0.46
197
+ * Enhancements
198
+ * 'include_key?' method use 'value_from_path'. Iterating through Hashes with 'include_key?' wouldn't work as expected with some JSON bodies with my current implementation
199
+
200
+ Version 0.0.45
201
+ * Enhancements
202
+ * No need to use 'name' when creating SoapHandler and RestHandler. Default is ClassName
203
+
204
+ Version 0.0.44
205
+ * Enhancements
206
+ * Test Server log to logs/test_server.log
207
+ * Simplify ExchangeHandler storing and retrieving values (see soap/hash_spec.rb)
208
+ * Make setting SoapHandler operation and other params possible through object instantiation. Less code needed
209
+
210
+ Version 0.0.43
211
+ * Bug fix
212
+ * Remove Environment namespace from 'soaspec-generate'
213
+ * Enhancements
214
+ * Convenience methods for REST calls in which you can call something like 'ClassInheritingRestHandler.get(params)' See 'spec/soaspec/rest/one_off_spec.rb' for details
215
+
216
+ Version 0.0.42
217
+ * Enhancements
218
+ * Set Soaspec.api_handler work class is created. No need to call '.to_s' method
219
+
220
+ Version 0.0.41
221
+ * Bug fix
222
+ * soaspec-generate not designed to work with virtual service. Rakefile not try to set that up
223
+
224
+ Version 0.0.40
225
+ * Enhancements
226
+ * soaspec-generate now handle a wsdl without parameters in the operation and rather look up input element type
227
+ * test_server virtual service now handle scenario where bank is not found and test made for that
228
+
229
+ Version 0.0.39
230
+ * Spec
231
+ * Create task to use soaspec-init to create test structure and test it.
232
+ * Enhancements
233
+ * Take away need to use Environment namespace
234
+ * Added response headers to REST response log
235
+ * Now using virtual Web Service for SOAP
236
+
237
+ Version 0.0.38
238
+ * Bug fix
239
+ * Fixed error in soaspec-generate. TODO: Test this in CI
240
+
241
+ Version 0.0.37 / 2018-3-16
242
+ * Enhancements
243
+ * Made retry_for_success method to keep making request until 200 status code if set on exchange
244
+ * If '$' not included for json_path, by default a '$..' is added for convenience
245
+
246
+ Version 0.0.36 / 2018-3-15
247
+ * Bug fix
248
+ * Make test name log in correct place
249
+ * Enhancements
250
+ * Made accessor 'mandatory_json_values' to make it easier to share mandatory json path - value pairs
251
+ * Created 'store' method for handler through which one can store a value and use it later on it in the same context
252
+ * Deprecated
253
+ * Removed old 'mandatory_elements', 'mandatory_xpath_values' overridden way of handling data for favor of new way of it setting 'expected_mandatory_elements'
254
+
255
+ Version 0.0.35 / 2018-3-13
256
+ * Enhancements
257
+ * Handle array of JSON hashes starting with '['
258
+ * Handle patch and put methods with data for REST
259
+
260
+ Version 0.0.34 / 2018-3-12
261
+ * Enhancements
262
+ * Add oauth2 and oauth2_file methods to make it easy to load oauth2 parameters. Still a work in progress to handle all oauth2 variations
263
+
264
+ Version 0.0.33 / 2018-3-9
265
+ * Enhancements
266
+ * Use 'jsonpath' instead of dig to check JSON responses. Much better for finding complex paths
267
+
268
+ Version 0.0.32 / 2018-3-9
269
+ * Enhancements
270
+ * Made :body key in hash that can be used to use JSON.generate for a payload when using rest_handler exchanges
271
+
272
+ Version 0.0.31 / 2018-3-8
273
+ * Enhancements
274
+ * Compacted unit tests for exchange handler
275
+ * Implemented include_key? and find via xpath for REST handler. See specs
276
+
277
+ Version 0.0.30 / 2018-3-6
278
+ * Bug fix
279
+ * Made generated class file name in soaspec-generate snakecase (was CamelCase)
280
+
281
+ Version 0.0.29 / 2018-3-6
282
+ * Refactorings
283
+ * Base 'test' class from 'Tester' to 'ExhangeHandler'
284
+ * Made default Soap Handler class 'SoapHandler' and making use of 'BasicSoapHandler' deprecated
285
+
286
+ Version 0.0.28 / 2018-3-6
287
+ * Enhancements
288
+ * Added not_found matcher and used in spec example
289
+ * Only call request upon first need of an Exchange response. This means test request is made as part of 'it' rather than in describe
290
+
291
+ Version 0.0.27 / 2018-3-5
292
+ * Bug fix
293
+ * Fixed log file not present error
294
+ * Updated exe binaries to use latest format
295
+
296
+ Version 0.0.26 / 2018-3-5
297
+ * Refactorings
298
+ * Using methods to define mandatory_elements, mandatory_xpath_values, root_attributes, base_url. Please see specs. This is shorter to type and clearer
299
+
300
+ Version 0.0.25 / 2018-2-25
301
+ * Enhancements
302
+ * Updated rest_handler to convert JSON and XML into Hash and use it in 'contain_value'. This still needs work.
303
+ * Showed example of workflow using 'pet' url
304
+
305
+ Version 0.0.24 / 2018-2-25
306
+ * Enhancements
307
+ * Added to soaspec-generate more types when creating YAML with data (int, boolean, double and custom enumeration).
308
+ * Binaries use common module (exe-helper) to reduce repeatability
309
+ * TODO: soaspec-generate read xsd's mentioned to import in WSDL schema
310
+
311
+ Version 0.0.23 / 2018-2-23
312
+ * Enhancements
313
+ * Created RestHandler class (Very messy and ugly still) to handle REST requests using style used for SOAP using Rest Client resource
314
+
315
+ Version 0.0.22 / 2018-2-15
316
+ * Enhancements
317
+ * Created new 'include_in_body' matcher to find value anywhere in response body (which could be a substring of an element)
318
+
319
+ Version 0.0.21 / 2018-1-29
320
+ * Enhancements
321
+ * Added soaspec-generate - still in POC mode to generate files from a WSDL.
322
+ * Added test_wsdl to start at validating xml according to WSDL. Still needs polishing
323
+
324
+ Version 0.0.20 / 2018-1-26
325
+ * Enhancements
326
+ * Added ability to strip namespaces 'Soaspec::Environment.strip_namespaces = true'. See spec for example
327
+ * Fixes
328
+ * Made custom error and used it to make 'have_element_at_xpath' work when negated
329
+
330
+ Version 0.0.19 / 2018-1-25
331
+ * Enhancements
332
+ * Added own shared examples to init script and to in built specs
333
+
334
+ Version 0.0.18 / 2018-1-25
335
+ * Fixes
336
+ * Updated 'soaspec-init' so that it works again.
337
+ * Enhancements
338
+ * Added example showing representing data for request in YAML
339
+
340
+ Version 0.0.17 / 2018-1-25
341
+ * Fixes
342
+ * Updated hash search so that it handles Array
343
+
344
+ Version 0.0.16 / 2018-1-23
345
+ * Fixes
346
+ * Corrected logic of auto convert to hash. Previous version did not handle test specific values correctly
347
+
348
+ Version 0.0.15 / 2018-1-23
349
+ * Fixes
350
+ * Updated code to convert string key in Savon request to key automatically by default before passing to Savon. This saves
351
+ the user doing the conversion themselves.
352
+
353
+ Version 0.0.14 / 2018-1-23
354
+ * Fixes
355
+ * Updated 'xml_to_yaml_file' exe to clean up YAML more. No more array for Hash value. Indenting needs work though.
356
+ Now it's more like something you can read and pass into Savon request.
357
+
358
+ Version 0.0.13 / 2018-1-23
359
+ * Enhancements
360
+ * Executable to create xml file from yaml
361
+
362
+ Version 0.0.12 / 2018/1-22
363
+ * Enhancements
364
+ * Example name added to log file
365
+
366
+ Version 0.0.10 / 2018-1-21
367
+ * Enhancements
368
+ * Added [] method to perform xpath assertion
369
+ * Using Savon xpath. No need to explicitly provide namespace for xpath
370
+
371
+ Version 0.0.9 / 2018-1-20
372
+ * Refactoring
373
+ * class_options -> savon_options - More specific
374
+ * default_operation -> operation - Not default anymore so better not in name
375
+ * Enhancements
376
+ * Made mandatory_xpath_values method to add to 'success scenarios' shared example
377
+
378
+ Version 0.0.8 / 2018-1-19
379
+ * Enhancements
380
+ * Added root_attributes method to add attribute to the root class
381
+
382
+ Version 0.0.7 / 2018-1-19
383
+ * Enhancements
384
+ * Added contain_key matcher
381
385
  * mandatory_elements method created for SoapHandler - can be used to add tests to success scenarios (see example get_weather_web_service class for details)