Skip to content

Commit

Permalink
[TESTING] Fix Kafka output test
Browse files Browse the repository at this point in the history
When doing randomized testing, one of the tests failed because kafka was not initialized yet

Fixes elastic#1758
  • Loading branch information
Richard Pijnenburg authored and jordansissel committed Sep 30, 2014
1 parent 42fa9ea commit 6daeb22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/outputs/kafka_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
end

it "should send logstash event to kafka broker" do
kafka = LogStash::Outputs::Kafka.new(kafka_config)
kafka.register
timestamp = LogStash::Timestamp.now
expect_any_instance_of(Kafka::Producer)
.to receive(:sendMsg)
.with("test", nil, "{\"message\":\"hello world\",\"host\":\"test\",\"@timestamp\":\"#{timestamp}\",\"@version\":\"1\"}")
e = LogStash::Event.new({"message" => "hello world", "host" => "test", "@timestamp" => timestamp})
kafka = LogStash::Outputs::Kafka.new(kafka_config)
kafka.register
kafka.receive(e)
end

Expand Down

0 comments on commit 6daeb22

Please sign in to comment.