Sha256: 13590c090a98b1e91d21ed1a731a0dbfb4399559cbe2f0fd189593e489c26e59

Contents?: true

Size: 1.11 KB

Versions: 20

Compression:

Stored size: 1.11 KB

Contents

# encoding: utf-8
require "spec_helper"
require "logstash/util/dead_letter_queue_manager"
require "logstash/execution_context"

describe LogStash::ExecutionContext do
  let(:pipeline) { double("pipeline") }
  let(:pipeline_id) { :main }
  let(:agent) { double("agent") }
  let(:plugin_id) { "plugin_id" }
  let(:plugin_type) { "plugin_type" }
  let(:dlq_writer) { LogStash::Util::DummyDeadLetterQueueWriter.new }

  before do
    allow(pipeline).to receive(:agent).and_return(agent)
    allow(pipeline).to receive(:pipeline_id).and_return(pipeline_id)
  end

  subject { described_class.new(pipeline, agent, plugin_id, plugin_type, dlq_writer) }

  it "returns the `pipeline_id`" do
    expect(subject.pipeline_id).to eq(pipeline_id)
  end

  it "returns the pipeline" do
    expect(subject.pipeline).to eq(pipeline)
  end

  it "returns the agent" do
    expect(subject.agent).to eq(agent)
  end

  it "returns the plugin-specific dlq writer" do
    expect(subject.dlq_writer.plugin_type).to eq(plugin_type)
    expect(subject.dlq_writer.plugin_id).to eq(plugin_id)
    expect(subject.dlq_writer.inner_writer).to eq(dlq_writer)
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
logstash-core-6.3.2-java spec/logstash/execution_context_spec.rb
logstash-core-6.3.1-java spec/logstash/execution_context_spec.rb
logstash-core-6.3.0-java spec/logstash/execution_context_spec.rb
logstash-core-6.2.4-java spec/logstash/execution_context_spec.rb
logstash-core-6.2.3-java spec/logstash/execution_context_spec.rb
logstash-core-6.1.4-java spec/logstash/execution_context_spec.rb
logstash-core-6.2.2-java spec/logstash/execution_context_spec.rb
logstash-core-6.2.1-java spec/logstash/execution_context_spec.rb
logstash-core-6.2.0-java spec/logstash/execution_context_spec.rb
logstash-core-6.1.3-java spec/logstash/execution_context_spec.rb
logstash-core-6.1.2-java spec/logstash/execution_context_spec.rb
logstash-core-6.1.1-java spec/logstash/execution_context_spec.rb
logstash-core-6.1.0-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.1-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.0-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.0.rc2-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.0.rc1-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.0.beta2-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.0.beta1-java spec/logstash/execution_context_spec.rb
logstash-core-6.0.0.alpha2-java spec/logstash/execution_context_spec.rb