MCPcopy
hub / github.com/IBM/sarama / TestClusterAdmin

Function TestClusterAdmin

admin_test.go:18–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

16)
17
18func TestClusterAdmin(t *testing.T) {
19 seedBroker := NewMockBroker(t, 1)
20 defer seedBroker.Close()
21
22 seedBroker.SetHandlerByMap(map[string]MockResponse{
23 "MetadataRequest": NewMockMetadataResponse(t).
24 SetController(seedBroker.BrokerID()).
25 SetBroker(seedBroker.Addr(), seedBroker.BrokerID()),
26 })
27
28 config := NewTestConfig()
29 config.Version = V1_0_0_0
30 admin, err := NewClusterAdmin([]string{seedBroker.Addr()}, config)
31 if err != nil {
32 t.Fatal(err)
33 }
34
35 err = admin.Close()
36 if err != nil {
37 t.Fatal(err)
38 }
39}
40
41func TestClusterAdminInvalidController(t *testing.T) {
42 seedBroker := NewMockBroker(t, 1)

Callers

nothing calls this directly

Calls 12

CloseMethod · 0.95
SetHandlerByMapMethod · 0.95
BrokerIDMethod · 0.95
AddrMethod · 0.95
CloseMethod · 0.95
NewMockBrokerFunction · 0.85
NewMockMetadataResponseFunction · 0.85
NewClusterAdminFunction · 0.85
SetBrokerMethod · 0.80
SetControllerMethod · 0.80
FatalMethod · 0.80
NewTestConfigFunction · 0.70

Tested by

no test coverage detected