Class: GovukMessageQueueConsumer::MockMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/govuk_message_queue_consumer/test_helpers/mock_message.rb

Instance Attribute Summary collapse

Attributes inherited from Message

#headers, #status

Instance Method Summary collapse

Constructor Details

#initialize(payload = {}, headers = {}, delivery_info = {}) ⇒ MockMessage

Returns a new instance of MockMessage.



11
12
13
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 11

def initialize(payload = {}, headers = {}, delivery_info = {})
  super(payload, OpenStruct.new(headers), OpenStruct.new(delivery_info))
end

Instance Attribute Details

#ackedObject (readonly) Also known as: acked?

Returns the value of attribute acked.



5
6
7
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5

def acked
  @acked
end

#delivery_infoObject (readonly)

Returns the value of attribute delivery_info.



5
6
7
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5

def delivery_info
  @delivery_info
end

#discardedObject (readonly) Also known as: discarded?

Returns the value of attribute discarded.



5
6
7
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5

def discarded
  @discarded
end

#headerObject (readonly)

Returns the value of attribute header.



5
6
7
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5

def header
  @header
end

#payloadObject (readonly)

Returns the value of attribute payload.



5
6
7
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5

def payload
  @payload
end

#retriedObject (readonly) Also known as: retried?

Returns the value of attribute retried.



5
6
7
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 5

def retried
  @retried
end

Instance Method Details

#ackObject



15
16
17
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 15

def ack
  @acked = true
end

#discardObject



23
24
25
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 23

def discard
  @discarded = true
end

#retryObject



19
20
21
# File 'lib/govuk_message_queue_consumer/test_helpers/mock_message.rb', line 19

def retry
  @retried = true
end