spec/inputs/rabbitmq_spec.rb in logstash-input-rabbitmq-5.2.2 vs spec/inputs/rabbitmq_spec.rb in logstash-input-rabbitmq-5.2.3

- old
+ new

@@ -128,11 +128,11 @@ end end describe "with a live server", :integration => true do let(:klass) { LogStash::Inputs::RabbitMQ } - let(:config) { {"host" => "127.0.0.1", "auto_delete" => true, "codec" => "plain" } } + let(:config) { {"host" => "127.0.0.1", "auto_delete" => true, "codec" => "plain", "add_field" => {"[@metadata][foo]" => "bar"} } } let(:instance) { klass.new(config) } let(:hare_info) { instance.instance_variable_get(:@hare_info) } let(:output_queue) { Queue.new } # Spawn a connection in the bg and wait up (n) seconds @@ -262,9 +262,13 @@ it "should save message headers into a @metadata field" do expect(event).to include("@metadata") expect(event.get("@metadata")).to include("rabbitmq_headers") expect(event.get("[@metadata][rabbitmq_headers]")).to include(headers) + end + + it "should properly decorate the event" do + expect(event.get("[@metadata][foo]")).to eq("bar") end end end describe LogStash::Inputs::RabbitMQ do