TestJavaProducerCompressionRoundTrip tests that messages produced by Kafka's Java console producer with various compression codecs can be correctly consumed and decompressed by Sarama.
(t *testing.T)
| 215 | // console producer with various compression codecs can be correctly consumed and |
| 216 | // decompressed by Sarama. |
| 217 | func TestJavaProducerCompressionRoundTrip(t *testing.T) { |
| 218 | setupFunctionalTest(t) |
| 219 | defer teardownFunctionalTest(t) |
| 220 | |
| 221 | for _, tc := range compressionTests { |
| 222 | t.Run(tc.codec.String(), func(t *testing.T) { |
| 223 | checkKafkaVersion(t, tc.minKafka) |
| 224 | |
| 225 | expected := []string{ |
| 226 | fmt.Sprintf("Message 1 with %s compression", tc.codec), |
| 227 | "Message 2", |
| 228 | "Message 3", |
| 229 | } |
| 230 | |
| 231 | initialOffset := endOffsetForPartition(t, "test.1", 0) |
| 232 | produceWithJava(t, "test.1", tc.codec, expected) |
| 233 | actual := consumeWithSarama(t, "test.1", initialOffset, len(expected)) |
| 234 | |
| 235 | require.Equal(t, expected, actual) |
| 236 | }) |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | // TestJavaConsumerCompressionRoundTrip tests that messages produced by Sarama |
| 241 | // with various compression codecs can be correctly consumed and decompressed |
nothing calls this directly
no test coverage detected