(t *testing.T)
| 74 | } |
| 75 | |
| 76 | func TestClientFetchCompressed(t *testing.T) { |
| 77 | client, topic, shutdown := newLocalClientAndTopic() |
| 78 | defer shutdown() |
| 79 | |
| 80 | records := produceRecords(t, 10, client.Addr, topic, &compress.GzipCodec) |
| 81 | |
| 82 | res, err := client.Fetch(context.Background(), &FetchRequest{ |
| 83 | Topic: topic, |
| 84 | Partition: 0, |
| 85 | Offset: 0, |
| 86 | MinBytes: 1, |
| 87 | MaxBytes: 64 * 1024, |
| 88 | MaxWait: 100 * time.Millisecond, |
| 89 | }) |
| 90 | |
| 91 | if err != nil { |
| 92 | t.Fatal(err) |
| 93 | } |
| 94 | |
| 95 | assertFetchResponse(t, res, &FetchResponse{ |
| 96 | Topic: topic, |
| 97 | Partition: 0, |
| 98 | HighWatermark: 10, |
| 99 | Records: NewRecordReader(records...), |
| 100 | }) |
| 101 | } |
| 102 | |
| 103 | func assertFetchResponse(t *testing.T, found, expected *FetchResponse) { |
| 104 | t.Helper() |
nothing calls this directly
no test coverage detected
searching dependent graphs…