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

Function TestMemberMetadata

joingroup_test.go:193–218  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

191}
192
193func TestMemberMetadata(t *testing.T) {
194 item := groupMetadata{
195 Version: 1,
196 Topics: []string{"a", "b"},
197 UserData: []byte(`blah`),
198 }
199
200 b := bytes.NewBuffer(nil)
201 w := &writeBuffer{w: b}
202 item.writeTo(w)
203
204 var found groupMetadata
205 remain, err := (&found).readFrom(bufio.NewReader(b), b.Len())
206 if err != nil {
207 t.Error(err)
208 t.FailNow()
209 }
210 if remain != 0 {
211 t.Errorf("expected 0 remain, got %v", remain)
212 t.FailNow()
213 }
214 if !reflect.DeepEqual(item, found) {
215 t.Error("expected item and found to be the same")
216 t.FailNow()
217 }
218}
219
220func TestJoinGroupResponse(t *testing.T) {
221 supportedVersions := []apiVersion{v1, v2}

Callers

nothing calls this directly

Calls 5

writeToMethod · 0.95
NewReaderMethod · 0.65
LenMethod · 0.65
readFromMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected