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 {
3131
3232 // Coordinator is the ID of the coordinator broker for the group.
3333 Coordinator int
34+
35+ // The group protocol type (eg "consumer", "connect")
36+ ProtocolType string
3437}
3538
3639func (c * Client ) ListGroups (
@@ -48,8 +51,9 @@ func (c *Client) ListGroups(
4851
4952 for _ , apiGroupInfo := range apiResp .Groups {
5053 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 ,
5357 })
5458 }
5559
Original file line number Diff line number Diff line change @@ -96,14 +96,21 @@ func TestClientListGroups(t *testing.T) {
9696 )
9797 }
9898 hasGroup := false
99+ hasProtocol := false
99100 for _ , group := range resp .Groups {
100101 if group .GroupID == gid {
101102 hasGroup = true
103+ if group .ProtocolType == "consumer" {
104+ hasProtocol = true
105+ }
102106 break
103107 }
104108 }
105109
106110 if ! hasGroup {
107111 t .Error ("Group not found in list" )
108112 }
113+ if ! hasProtocol {
114+ t .Error ("Group does not have expected protocol type" )
115+ }
109116}
You can’t perform that action at this time.
0 commit comments