Skip to content

Conversation

@choonkeat
Copy link

Supersede #123

Audit supplier server is a rack app serving static jsons from spec/fixtures/audit

$ bundle exec rackup spec/fixtures/audit/config.ru
[2016-07-26 14:35:14] INFO  WEBrick 1.3.1
[2016-07-26 14:35:14] INFO  ruby 2.3.0 (2015-12-25) [x86_64-darwin14]
[2016-07-26 14:35:14] INFO  WEBrick::HTTPServer#start: pid=33023 port=9292

When request param property_id (quote, book) or reservation_number (cancel) is an error like connection_timeout, the rack server will respond accordingly to simulate the error. i.e. requests for a specific property or reservation will always get the same response.

Sync workers will hit a /spec/fixtures/audit/properties.json url, which serves a list of properties with property_id values from success, connection_timeout, ...

When consumers search and book, certain Audit properties (e.g. property_id: success) will always succeed; and certain Audit properties (depending on property_id) will always hit the same error.

When consumer try to cancel the booking, depending on the reference_number, the cancellation will always succeed or encounter an error


audit:
secret_key: <%= ENV.fetch('AUDIT_SECRET_KEY', 'test_secret') %>
host: http://localhost:9292
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't actually hit the servers on test, do we?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, but the full YAML is here to put things through its paces

- connection_timeout
- invalid_json
- wrong_json
which returns an array of "fixtures/audit/property.json" with "identifier" being set to success, connection_timeout, etc ...
Otherwise, "base_currency = self.to_currency(base_currency)" becomes nil
Update PropertySynchronisation usage based on e1a33dd
@choonkeat choonkeat force-pushed the feature/audit_supplier branch from 18ffd3d to f142eed Compare August 11, 2016 16:16
@choonkeat
Copy link
Author

Rebased with development and added f142eed to catch up on the changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants