(t *testing.T)
| 95 | } |
| 96 | |
| 97 | func TestProducerWithTooManyExpectations(t *testing.T) { |
| 98 | trm := newTestReporterMock() |
| 99 | mp := NewAsyncProducer(trm, nil). |
| 100 | ExpectInputAndSucceed(). |
| 101 | ExpectInputAndFail(sarama.ErrOutOfBrokers) |
| 102 | |
| 103 | mp.Input() <- &sarama.ProducerMessage{Topic: "test"} |
| 104 | if err := mp.Close(); err != nil { |
| 105 | t.Error(err) |
| 106 | } |
| 107 | |
| 108 | if len(trm.errors) != 1 { |
| 109 | t.Error("Expected to report an error") |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | func TestProducerFailTxn(t *testing.T) { |
| 114 | config := NewTestConfig() |
nothing calls this directly
no test coverage detected