Debian Codegraph @

add_partitions_to_txn_response_test.go

raw symbols SCIP
1 //go:build !functional
2
3 package sarama
4
5 import (
6 "testing"
7 "time"
8 )
9
10 var addPartitionsToTxnResponse = []byte{
11 0, 0, 0, 100,
12 0, 0, 0, 1,
13 0, 5, 't', 'o', 'p', 'i', 'c',
14 0, 0, 0, 1, // 1 partition error
15 0, 0, 0, 2, // partition 2
16 0, 48, // error
17 }
18
19 func TestAddPartitionsToTxnResponse(t *testing.T) {
20 resp := &AddPartitionsToTxnResponse{
21 ThrottleTime: 100 * time.Millisecond,
22 Errors: map[string][]*PartitionError{
23 "topic": {{
24 Err: ErrInvalidTxnState,
25 Partition: 2,
26 }},
27 },
28 }
29
30 testResponse(t, "", resp, addPartitionsToTxnResponse)
31 }