Skip to content

Commit c928408

Browse files
committed
[test] updated test on overflow of fixed 'decode_size_limit_bytes' to not raise an error bu create an Event, tag it appropriately and slice the offending data into 'message' field
1 parent 76ff6ff commit c928408

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spec/codecs/json_lines_spec.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@
131131
end
132132

133133
it "should raise an error if the max bytes are exceeded" do
134-
expect {
135-
subject.decode(maximum_payload << "z")
136-
}.to raise_error(java.lang.IllegalStateException, "input buffer full")
134+
subject.decode(maximum_payload << "z") do |event|
135+
expect(event.get("tags")).to include("_jsonparse_too_big_failure")
136+
expect(event.get("message").size).to eq(decode_size_limit_bytes)
137+
end
137138
end
138139
end
139140

0 commit comments

Comments
 (0)