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

Function TestClientApiVersions

apiversions_test.go:8–33  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

6)
7
8func TestClientApiVersions(t *testing.T) {
9 ctx := context.Background()
10
11 client, shutdown := newLocalClient()
12 defer shutdown()
13
14 resp, err := client.ApiVersions(ctx, &ApiVersionsRequest{})
15 if err != nil {
16 t.Fatal(err)
17 }
18 if resp.Error != nil {
19 t.Error(
20 "Unexpected error in response",
21 "expected", nil,
22 "got", resp.Error,
23 )
24 }
25
26 if len(resp.ApiKeys) == 0 {
27 t.Error(
28 "Unexpected apiKeys length",
29 "expected greater than", 0,
30 "got", 0,
31 )
32 }
33}

Callers

nothing calls this directly

Calls 3

newLocalClientFunction · 0.70
ApiVersionsMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected