github.com/segmentio/kafka-go@v0.4.48-0.20240318174348-3f6244eb34fd/protocol/offsetdelete/offsetdelete_test.go (about) 1 package offsetdelete_test 2 3 import ( 4 "testing" 5 6 "github.com/segmentio/kafka-go/protocol/offsetdelete" 7 "github.com/segmentio/kafka-go/protocol/prototest" 8 ) 9 10 func TestOffsetDeleteRequest(t *testing.T) { 11 for _, version := range []int16{0} { 12 prototest.TestRequest(t, version, &offsetdelete.Request{ 13 GroupID: "group-0", 14 Topics: []offsetdelete.RequestTopic{ 15 { 16 Name: "topic-0", 17 Partitions: []offsetdelete.RequestPartition{ 18 { 19 PartitionIndex: 0, 20 }, 21 { 22 PartitionIndex: 1, 23 }, 24 }, 25 }, 26 }, 27 }) 28 } 29 } 30 31 func TestOffsetDeleteResponse(t *testing.T) { 32 for _, version := range []int16{0} { 33 prototest.TestResponse(t, version, &offsetdelete.Response{ 34 ErrorCode: 0, 35 Topics: []offsetdelete.ResponseTopic{ 36 { 37 Name: "topic-0", 38 Partitions: []offsetdelete.ResponsePartition{ 39 { 40 PartitionIndex: 0, 41 ErrorCode: 1, 42 }, 43 { 44 PartitionIndex: 1, 45 ErrorCode: 1, 46 }, 47 }, 48 }, 49 }, 50 }) 51 } 52 }