-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Expand file tree
/
Copy pathacl_create_response_test.go
More file actions
58 lines (48 loc) · 1.06 KB
/
Copy pathacl_create_response_test.go
File metadata and controls
58 lines (48 loc) · 1.06 KB
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
53
54
55
56
57
58
//go:build !functional
package sarama
import (
"testing"
"time"
)
var (
createResponseWithError = []byte{
0, 0, 0, 100,
0, 0, 0, 1,
0, 42,
0, 5, 'e', 'r', 'r', 'o', 'r',
}
createResponseArray = []byte{
0, 0, 0, 100,
0, 0, 0, 2,
0, 42,
0, 5, 'e', 'r', 'r', 'o', 'r',
0, 0,
255, 255,
}
createResponseArrayV2 = []byte{
0, 0, 0, 100,
3,
0, 42,
6, 'e', 'r', 'r', 'o', 'r',
0, // empty tagged fields
0, 0,
0, // nil error message
0, // empty tagged fields
0, // empty tagged fields
}
)
func TestCreateAclsResponse(t *testing.T) {
errmsg := "error"
resp := &CreateAclsResponse{
ThrottleTime: 100 * time.Millisecond,
AclCreationResponses: []*AclCreationResponse{{
Err: ErrInvalidRequest,
ErrMsg: &errmsg,
}},
}
testResponse(t, "response with error", resp, createResponseWithError)
resp.AclCreationResponses = append(resp.AclCreationResponses, new(AclCreationResponse))
testResponse(t, "response array", resp, createResponseArray)
resp.Version = 2
testResponse(t, "response array v2", resp, createResponseArrayV2)
}