MCPcopy
hub / github.com/IBM/sarama / TestOffsetFetchResponseMultipleGroupsV8

Function TestOffsetFetchResponseMultipleGroupsV8

offset_fetch_response_test.go:184–204  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

182}
183
184func TestOffsetFetchResponseMultipleGroupsV8(t *testing.T) {
185 response := OffsetFetchResponse{
186 Version: 8,
187 ThrottleTimeMs: 9,
188 Blocks: map[string]map[int32]*OffsetFetchResponseBlock{},
189 Groups: []OffsetFetchResponseGroup{
190 {GroupId: "blah", Blocks: map[string]map[int32]*OffsetFetchResponseBlock{}, Err: ErrNoError},
191 {GroupId: "qux", Blocks: map[string]map[int32]*OffsetFetchResponseBlock{}, Err: ErrInvalidRequest},
192 },
193 }
194 testResponse(t, "two groups v8", &response, offsetFetchResponseTwoGroupsV8)
195
196 decoded := new(OffsetFetchResponse)
197 require.NoError(t, versionedDecode(offsetFetchResponseTwoGroupsV8, decoded, 8, nil))
198 require.Len(t, decoded.Groups, 2)
199 assert.Equal(t, "blah", decoded.Groups[0].GroupId)
200 assert.Equal(t, ErrNoError, decoded.Groups[0].Err)
201 assert.Equal(t, "qux", decoded.Groups[1].GroupId)
202 assert.Equal(t, ErrInvalidRequest, decoded.Groups[1].Err)
203 assert.Equal(t, ErrNoError, decoded.GroupError())
204}

Callers

nothing calls this directly

Calls 4

testResponseFunction · 0.85
versionedDecodeFunction · 0.85
GroupErrorMethod · 0.80
LenMethod · 0.45

Tested by

no test coverage detected