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

Function TestUnsupportedSASLMechanism

conn_test.go:1156–1171  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1154}
1155
1156func TestUnsupportedSASLMechanism(t *testing.T) {
1157 ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
1158 defer cancel()
1159
1160 conn, err := (&Dialer{
1161 Resolver: &net.Resolver{},
1162 }).DialContext(ctx, "tcp", "127.0.0.1:9093")
1163 if err != nil {
1164 t.Fatal("failed to open a new kafka connection:", err)
1165 }
1166 defer conn.Close()
1167
1168 if err := conn.saslHandshake("FOO"); !errors.Is(err, UnsupportedSASLMechanism) {
1169 t.Errorf("Expected UnsupportedSASLMechanism but got %v", err)
1170 }
1171}
1172
1173const benchmarkMessageCount = 100
1174

Callers

nothing calls this directly

Calls 3

DialContextMethod · 0.80
saslHandshakeMethod · 0.80
CloseMethod · 0.45

Tested by

no test coverage detected