From fa199fe1ecea3cccde87c0d49dc27ff8105934aa Mon Sep 17 00:00:00 2001 From: Karol Bucek Date: Thu, 12 Dec 2019 20:18:39 +0100 Subject: [PATCH] Test: Java proxied QueueReadClient unwrapping Fixes #11391 --- .../logstash/util/wrapped_synchronous_queue_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/logstash-core/spec/logstash/util/wrapped_synchronous_queue_spec.rb b/logstash-core/spec/logstash/util/wrapped_synchronous_queue_spec.rb index c81e59c97..22b3098de 100644 --- a/logstash-core/spec/logstash/util/wrapped_synchronous_queue_spec.rb +++ b/logstash-core/spec/logstash/util/wrapped_synchronous_queue_spec.rb @@ -117,6 +117,16 @@ describe LogStash::WrappedSynchronousQueue do (0..2).each {|i| expect(received).to include("value-#{i}")} (3..4).each {|i| expect(received).to include("generated-#{i}")} end + + it "handles Java proxied read-batch object" do + batch = [] + 3.times { |i| batch.push(LogStash::Event.new({"message" => "value-#{i}"})) } + write_client.push_batch(batch) + + read_batch = read_client.read_batch + expect { read_client.close_batch(read_batch) }.to_not raise_error + expect { read_client.close_batch(read_batch.to_java) }.to_not raise_error + end end end end