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

Function testConnect

sasl/sasl_test.go:91–104  ·  view source on GitHub ↗
(t *testing.T, mechanism sasl.Mechanism, success bool)

Source from the content-addressed store, hash-verified

89}
90
91func testConnect(t *testing.T, mechanism sasl.Mechanism, success bool) {
92 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
93 defer cancel()
94
95 d := kafka.Dialer{
96 SASLMechanism: mechanism,
97 }
98 _, err := d.DialLeader(ctx, "tcp", saslTestConnect, saslTestTopic, 0)
99 if success && err != nil {
100 t.Errorf("should have logged in correctly, got err: %v", err)
101 } else if !success && err == nil {
102 t.Errorf("should not have logged in correctly")
103 }
104}

Callers 1

TestSASLFunction · 0.85

Calls 1

DialLeaderMethod · 0.95

Tested by

no test coverage detected