Debian Codegraph @

alter_partition_reassignments_response_test.go

raw symbols SCIP
1 //go:build !functional
2
3 package sarama
4
5 import "testing"
6
7 var (
8 alterPartitionReassignmentsResponseNoError = []byte{
9 0, 0, 39, 16, // ThrottleTimeMs 10000
10 0, 0, // errorcode
11 0, // null string
12 1, // empty errors array
13 0, // empty tagged fields
14 }
15
16 alterPartitionReassignmentsResponseWithError = []byte{
17 0, 0, 39, 16, // ThrottleTimeMs 10000
18 0, 12, // errorcode
19 6, 101, 114, 114, 111, 114, // error string "error"
20 2, // errors array length 1
21 6, 116, 111, 112, 105, 99, // topic name "topic"
22 2, // partition array length 1
23 0, 0, 0, 1, // partitionId
24 0, 3, // kerror
25 7, 101, 114, 114, 111, 114, 50, // error string "error2"
26 0, 0, 0, // empty tagged fields
27 }
28 )
29
30 func TestAlterPartitionReassignmentResponse(t *testing.T) {
31 var response *AlterPartitionReassignmentsResponse = &AlterPartitionReassignmentsResponse{
32 ThrottleTimeMs: int32(10000),
33 Version: int16(0),
34 }
35
36 testResponse(t, "no error", response, alterPartitionReassignmentsResponseNoError)
37
38 errorMessage := "error"
39 partitionError := "error2"
40 response.ErrorCode = 12
41 response.ErrorMessage = &errorMessage
42 response.AddError("topic", 1, 3, &partitionError)
43
44 testResponse(t, "with error", response, alterPartitionReassignmentsResponseWithError)
45 }