File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ type ListGroupsResponseGroup struct {
31
31
32
32
// Coordinator is the ID of the coordinator broker for the group.
33
33
Coordinator int
34
+
35
+ // The group protocol type (eg "consumer", "connect")
36
+ ProtocolType string
34
37
}
35
38
36
39
func (c * Client ) ListGroups (
@@ -48,8 +51,9 @@ func (c *Client) ListGroups(
48
51
49
52
for _ , apiGroupInfo := range apiResp .Groups {
50
53
resp .Groups = append (resp .Groups , ListGroupsResponseGroup {
51
- GroupID : apiGroupInfo .GroupID ,
52
- Coordinator : int (apiGroupInfo .BrokerID ),
54
+ GroupID : apiGroupInfo .GroupID ,
55
+ Coordinator : int (apiGroupInfo .BrokerID ),
56
+ ProtocolType : apiGroupInfo .ProtocolType ,
53
57
})
54
58
}
55
59
Original file line number Diff line number Diff line change @@ -96,14 +96,21 @@ func TestClientListGroups(t *testing.T) {
96
96
)
97
97
}
98
98
hasGroup := false
99
+ hasProtocol := false
99
100
for _ , group := range resp .Groups {
100
101
if group .GroupID == gid {
101
102
hasGroup = true
103
+ if group .ProtocolType == "consumer" {
104
+ hasProtocol = true
105
+ }
102
106
break
103
107
}
104
108
}
105
109
106
110
if ! hasGroup {
107
111
t .Error ("Group not found in list" )
108
112
}
113
+ if ! hasProtocol {
114
+ t .Error ("Group does not have expected protocol type" )
115
+ }
109
116
}
You can’t perform that action at this time.
0 commit comments