lib/rimless/rspec/helpers.rb
# A simple helper to fake a deserialized Apache Kafka message for
# consuming.
#
# @param payload [Hash{Symbol => Mixed}] the message payload
# @param topic [String, Hash{Symbol => Mixed}] the actual message
#   topic (full as string, or parts via hash)
# @return [OpenStruct] the fake deserialized Kafka message
#
# rubocop:disable Metrics/MethodLength because of the various properties
A simple helper to fake a deserialized Apache Kafka message for
consuming.
A simple helper to fake a deserialized Apache Kafka message for consuming .
def kafka_message(topic: nil, headers: {}, **payload)
        OpenStruct.new(
          topic: Rimless.topic(topic),
          headers: headers,
          payload: payload,
          is_control_record: false,
          key: nil,
          offset: 206,
          partition: 0,
          create_time: Time.current,
          receive_time: Time.current,
          deserialized: true
        )
      end
def kafka_message ( topic : nil , headers : { } , ** payload ) OpenStruct . new ( topic : Rimless . topic ( topic ) , headers : headers , payload : payload , is_control_record : false , key : nil , offset : 206 , partition : 0 , create_time : Time . current , receive_time : Time . current , deserialized : true ) end
A simple helper to fake a deserialized Apache Kafka message for
consuming.
A simple helper to fake a deserialized Apache Kafka message for consuming .
the fake deserialized Kafka message rubocop:disable Metrics/MethodLength because of the various properties
the fake deserialized Kafka message rubocop : disable Metrics / MethodLength because of the various properties
OpenStruct
topic
the actual message topic (full as string, or parts via hash)
the actual message topic ( full as string or parts via hash )
headers
payload
the message payload
the message payload