Sha256: a95a9aed4115188cd4fb55ae35f1367086f7f4b9f109dea0b64db9c7f7596e42

Contents?: true

Size: 742 Bytes

Versions: 24

Compression:

Stored size: 742 Bytes

Contents

# frozen_string_literal: true

module Phobos
  module Test
    module Helper
      TOPIC = 'test-topic'
      GROUP = 'test-group'

      def process_message(handler:, payload:, metadata: {}, force_encoding: nil)
        listener = Phobos::Listener.new(
          handler: handler,
          group_id: GROUP,
          topic: TOPIC, force_encoding: force_encoding
        )

        message = Kafka::FetchedMessage.new(
          message: Kafka::Protocol::Message.new(value: payload, key: nil, offset: 13),
          topic: TOPIC, partition: 0
        )

        Phobos::Actions::ProcessMessage.new(
          listener: listener,
          message: message,
          listener_metadata: metadata
        ).execute
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
phobos-2.1.6 lib/phobos/test/helper.rb
phobos-2.1.5 lib/phobos/test/helper.rb
phobos-2.1.4 lib/phobos/test/helper.rb
phobos-2.1.3 lib/phobos/test/helper.rb
phobos-2.1.2 lib/phobos/test/helper.rb
phobos-2.1.1 lib/phobos/test/helper.rb
phobos_temp_fork-0.0.4 lib/phobos/test/helper.rb
phobos_temp_fork-0.0.3 lib/phobos/test/helper.rb
phobos_temp_fork-0.0.2 lib/phobos/test/helper.rb
phobos_temp_fork-0.0.1 lib/phobos/test/helper.rb
phobos-2.1.0 lib/phobos/test/helper.rb
phobos-2.0.2 lib/phobos/test/helper.rb
phobos-2.0.1 lib/phobos/test/helper.rb
phobos-2.0.0.pre.beta1 lib/phobos/test/helper.rb
phobos-1.9.0 lib/phobos/test/helper.rb
phobos-1.9.0.pre.beta3 lib/phobos/test/helper.rb
phobos-1.9.0.pre.beta2 lib/phobos/test/helper.rb
phobos-1.9.0.pre.beta1 lib/phobos/test/helper.rb
phobos-1.8.3.pre.beta2 lib/phobos/test/helper.rb
phobos-1.8.3.pre.beta1 lib/phobos/test/helper.rb