lib/maitredee/adapters/test_adapter.rb in maitredee-0.8.3 vs lib/maitredee/adapters/test_adapter.rb in maitredee-0.8.4
- old
+ new
@@ -19,6 +19,31 @@
def reset
messages.clear
end
end
end
+
+ class Subscriber
+ def self.test(
+ body:,
+ event_name: nil,
+ message_id: SecureRandom.uuid,
+ sent_at: Time.now,
+ primary_key: nil
+ )
+ message = SubscriberMessage.new(
+ topic_name: topic_name,
+ body: body,
+ event_name: event_name,
+ message_id: message_id,
+ sent_at: sent_at.to_i,
+ primary_key: primary_key,
+ schema_name: nil,
+ broker_message_id: message_id,
+ maitredee_version: Maitredee::VERSION,
+ raw_message: nil,
+ adapter_message: nil
+ )
+ process(message)
+ end
+ end
end