MCPcopy
hub / github.com/segmentio/kafka-go / TestClientFetchCompressed

Function TestClientFetchCompressed

fetch_test.go:76–101  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func 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
103func assertFetchResponse(t *testing.T, found, expected *FetchResponse) {
104 t.Helper()

Callers

nothing calls this directly

Calls 5

produceRecordsFunction · 0.85
assertFetchResponseFunction · 0.85
FetchMethod · 0.80
newLocalClientAndTopicFunction · 0.70
NewRecordReaderFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…