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

Function TestOffsetCommitResponse

protocol/offsetcommit/offsetcommit_test.go:183–220  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

181}
182
183func TestOffsetCommitResponse(t *testing.T) {
184 // Fields are the same through version 2.
185 for _, version := range []int16{0, 1, 2} {
186 prototest.TestResponse(t, version, &offsetcommit.Response{
187 Topics: []offsetcommit.ResponseTopic{
188 {
189 Name: "topic-1",
190 Partitions: []offsetcommit.ResponsePartition{
191 {
192 PartitionIndex: 4,
193 ErrorCode: 34,
194 },
195 },
196 },
197 },
198 })
199 }
200
201 // Version 3 added:
202 // ThrottleTimeMs
203 // Field are the same through version 7.
204 for _, version := range []int16{3, 4, 5, 6, 7} {
205 prototest.TestResponse(t, version, &offsetcommit.Response{
206 ThrottleTimeMs: 10000,
207 Topics: []offsetcommit.ResponseTopic{
208 {
209 Name: "topic-2",
210 Partitions: []offsetcommit.ResponsePartition{
211 {
212 PartitionIndex: 2,
213 ErrorCode: 3,
214 },
215 },
216 },
217 },
218 })
219 }
220}

Callers

nothing calls this directly

Calls 1

TestResponseFunction · 0.92

Tested by

no test coverage detected