(t *testing.T, found, expected *FetchResponse)
| 101 | } |
| 102 | |
| 103 | func 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 | |
| 135 | type memoryRecord struct { |
| 136 | offset int64 |
no test coverage detected