mirror of
https://github.com/elastic/logstash.git
synced 2025-04-23 22:27:21 -04:00
[TESTING] Fix Kafka output test
When doing randomized testing, one of the tests failed because kafka was not initialized yet Fixes #1758
This commit is contained in:
parent
7732d2287d
commit
e7d41e3c80
1 changed files with 2 additions and 2 deletions
|
@ -26,13 +26,13 @@ describe LogStash::Outputs::Kafka do
|
|||
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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue