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

Function assertFetchResponse

fetch_test.go:103–133  ·  view source on GitHub ↗
(t *testing.T, found, expected *FetchResponse)

Source from the content-addressed store, hash-verified

101}
102
103func assertFetchResponse(t *testing.T, found, expected *FetchResponse) {
104 t.Helper()
105
106 if found.Topic != expected.Topic {
107 t.Error("invalid topic found in response:", found.Topic)
108 }
109
110 if found.Partition != expected.Partition {
111 t.Error("invalid partition found in response:", found.Partition)
112 }
113
114 if found.HighWatermark != expected.HighWatermark {
115 t.Error("invalid high watermark found in response:", found.HighWatermark)
116 }
117
118 if found.Error != nil {
119 t.Error("unexpected error found in response:", found.Error)
120 }
121
122 records1, err := readRecords(found.Records)
123 if err != nil {
124 t.Error("error reading records:", err)
125 }
126
127 records2, err := readRecords(expected.Records)
128 if err != nil {
129 t.Error("error reading records:", err)
130 }
131
132 assertRecords(t, records1, records2)
133}
134
135type memoryRecord struct {
136 offset int64

Callers 2

TestClientFetchFunction · 0.85

Calls 3

readRecordsFunction · 0.85
assertRecordsFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected