-
Notifications
You must be signed in to change notification settings - Fork 0
Audit (Supplier)
Audit is a mock supplier to provide properties to Concierge.
Since the main concern is Concierge's ability to talk to suppliers, Audit server does not actually have mutating states (i.e no db, updates,...)
The difference with other suppliers is that Audit provides JSON to Concierge that does not need further translation (i.e. the schema is identical) to avoid translation errors. If Concierge model attributes changes, simply edit the matching spec/fixtures/audit/*.json
files accordingly
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 a consumer tries to cancel the booking, depending on the reference_number
, the cancellation will always succeed or encounter an error