| 524 | } |
| 525 | |
| 526 | func (mr *MockOffsetCommitResponse) For(reqBody versionedDecoder) encoderWithHeader { |
| 527 | req := reqBody.(*OffsetCommitRequest) |
| 528 | group := req.ConsumerGroup |
| 529 | res := &OffsetCommitResponse{Version: req.version()} |
| 530 | for topic, partitions := range req.blocks { |
| 531 | for partition := range partitions { |
| 532 | res.AddError(topic, partition, mr.getError(group, topic, partition)) |
| 533 | } |
| 534 | } |
| 535 | return res |
| 536 | } |
| 537 | |
| 538 | func (mr *MockOffsetCommitResponse) getError(group, topic string, partition int32) KError { |
| 539 | topics := mr.errors[group] |