(t *testing.T)
| 42 | } |
| 43 | |
| 44 | func TestCompression(t *testing.T) { |
| 45 | msg := kafka.Message{ |
| 46 | Value: []byte("message"), |
| 47 | } |
| 48 | |
| 49 | testEncodeDecode(t, msg, new(gzip.Codec)) |
| 50 | testEncodeDecode(t, msg, new(snappy.Codec)) |
| 51 | testEncodeDecode(t, msg, new(lz4.Codec)) |
| 52 | if ktesting.KafkaIsAtLeast("2.1.0") { |
| 53 | testEncodeDecode(t, msg, new(zstd.Codec)) |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | func compress(codec pkg.Codec, src []byte) ([]byte, error) { |
| 58 | b := new(bytes.Buffer) |
nothing calls this directly
no test coverage detected