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