MCPcopy
hub / github.com/segmentio/kafka-go / testBrokers

Function testBrokers

conn_test.go:1107–1120  ·  view source on GitHub ↗
(t *testing.T, conn *Conn)

Source from the content-addressed store, hash-verified

1105}
1106
1107func testBrokers(t *testing.T, conn *Conn) {
1108 brokers, err := conn.Brokers()
1109 if err != nil {
1110 t.Error(err)
1111 }
1112
1113 if len(brokers) != 1 {
1114 t.Errorf("expected 1 broker in %+v", brokers)
1115 }
1116
1117 if brokers[0].ID != 1 {
1118 t.Errorf("expected ID 1 received %d", brokers[0].ID)
1119 }
1120}
1121
1122func testConnBroker(t *testing.T, conn *Conn) {
1123 broker := conn.Broker()

Callers

nothing calls this directly

Calls 2

BrokersMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected