|
35 | 35 | 0, // Empty tag buffer |
36 | 36 | 0, // Empty tag buffer |
37 | 37 | } |
| 38 | + |
| 39 | + listGroupResponseV5 = []byte{ |
| 40 | + 0, 0, 0, 0, // no throttle time |
| 41 | + 0, 0, // no error |
| 42 | + 2, // compact array length (1) |
| 43 | + 4, 'f', 'o', 'o', // group name (compact string) |
| 44 | + 9, 'c', 'o', 'n', 's', 'u', 'm', 'e', 'r', // protocol type (compact string) |
| 45 | + 6, 'E', 'm', 'p', 't', 'y', // state (compact string) |
| 46 | + 8, 'C', 'l', 'a', 's', 's', 'i', 'c', // type (compact string) |
| 47 | + 0, // Empty tag buffer |
| 48 | + 0, // Empty tag buffer |
| 49 | + } |
38 | 50 | ) |
39 | 51 |
|
40 | 52 | func TestListGroupsResponse(t *testing.T) { |
@@ -82,6 +94,24 @@ func TestListGroupsResponse(t *testing.T) { |
82 | 94 | t.Error("Expected foo group to use consumer protocol") |
83 | 95 | } |
84 | 96 | if response.GroupsData["foo"].GroupState != "Empty" { |
85 | | - t.Error("Expected foo grup to have empty state") |
| 97 | + t.Error("Expected foo group to have empty state") |
| 98 | + } |
| 99 | + |
| 100 | + response = new(ListGroupsResponse) |
| 101 | + testVersionDecodable(t, "no error", response, listGroupResponseV5, 5) |
| 102 | + if !errors.Is(response.Err, ErrNoError) { |
| 103 | + t.Error("Expected no gerror, found:", response.Err) |
| 104 | + } |
| 105 | + if len(response.Groups) != 1 { |
| 106 | + t.Error("Expected one group") |
| 107 | + } |
| 108 | + if response.Groups["foo"] != "consumer" { |
| 109 | + t.Error("Expected foo group to use consumer protocol") |
| 110 | + } |
| 111 | + if response.GroupsData["foo"].GroupState != "Empty" { |
| 112 | + t.Error("Expected foo group to have empty state") |
| 113 | + } |
| 114 | + if response.GroupsData["foo"].GroupType != "Classic" { |
| 115 | + t.Error("Expected foo group to have type 'Classic', found: ", response.GroupsData["foo"].GroupType) |
86 | 116 | } |
87 | 117 | } |
0 commit comments