NewMockBroker launches a fake Kafka broker. It takes a TestReporter as provided by the test framework and a channel of responses to use. If an error occurs it is simply logged to the TestReporter and the broker exits.
(t TestReporter, brokerID int32)
| 404 | // test framework and a channel of responses to use. If an error occurs it is |
| 405 | // simply logged to the TestReporter and the broker exits. |
| 406 | func NewMockBroker(t TestReporter, brokerID int32) *MockBroker { |
| 407 | return NewMockBrokerAddr(t, brokerID, "localhost:0") |
| 408 | } |
| 409 | |
| 410 | // NewMockBrokerAddr behaves like newMockBroker but listens on the address you give |
| 411 | // it rather than just some ephemeral port. |