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