Class: PactWaterdropClient
- Inherits:
-
Object
- Object
- PactWaterdropClient
- Defined in:
- lib/sbmt/pact/rspec/support/waterdrop/pact_waterdrop_client.rb
Defined Under Namespace
Classes: Report
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
Instance Method Summary collapse
- #produce_async(message) ⇒ Object
- #produce_sync(message) ⇒ Object
- #to_pact(content_type: nil) ⇒ Object
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/sbmt/pact/rspec/support/waterdrop/pact_waterdrop_client.rb', line 4 def @message end |
Instance Method Details
#produce_async(message) ⇒ Object
8 9 10 |
# File 'lib/sbmt/pact/rspec/support/waterdrop/pact_waterdrop_client.rb', line 8 def produce_async() @message = end |
#produce_sync(message) ⇒ Object
12 13 14 15 |
# File 'lib/sbmt/pact/rspec/support/waterdrop/pact_waterdrop_client.rb', line 12 def produce_sync() @message = Report.new(partition: 0, offset: 0, topic_name: [:topic]) end |
#to_pact(content_type: nil) ⇒ Object
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/sbmt/pact/rspec/support/waterdrop/pact_waterdrop_client.rb', line 17 def to_pact(content_type: nil) payload = [:payload] = { key: [:key], topic: [:topic], content_type: content_type }.merge([:headers] || {}) [payload, ] end |