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

Function TestBrokerAccessors

broker_test.go:58–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

56}
57
58func TestBrokerAccessors(t *testing.T) {
59 broker := NewBroker("abc:123")
60
61 if broker.ID() != -1 {
62 t.Error("New broker didn't have an ID of -1.")
63 }
64
65 if broker.Addr() != "abc:123" {
66 t.Error("New broker didn't have the correct address")
67 }
68
69 if broker.Rack() != "" {
70 t.Error("New broker didn't have an unknown rack.")
71 }
72
73 broker.id = 34
74 if broker.ID() != 34 {
75 t.Error("Manually setting broker ID did not take effect.")
76 }
77
78 rack := "dc1"
79 broker.rack = &rack
80 if broker.Rack() != rack {
81 t.Error("Manually setting broker rack did not take effect.")
82 }
83}
84
85type produceResponsePromise struct {
86 c chan produceResOrError

Callers

nothing calls this directly

Calls 5

IDMethod · 0.95
AddrMethod · 0.95
RackMethod · 0.95
NewBrokerFunction · 0.85
ErrorMethod · 0.65

Tested by

no test coverage detected