(t *testing.T)
| 252 | } |
| 253 | |
| 254 | func TestConsumerMeetsErrorsDrainedExpectation(t *testing.T) { |
| 255 | trm := newTestReporterMock() |
| 256 | consumer := NewConsumer(trm, NewTestConfig()) |
| 257 | |
| 258 | consumer.ExpectConsumePartition("test", 0, sarama.OffsetOldest). |
| 259 | YieldError(sarama.ErrInvalidMessage). |
| 260 | YieldError(sarama.ErrInvalidMessage). |
| 261 | ExpectErrorsDrainedOnClose() |
| 262 | |
| 263 | pc, err := consumer.ConsumePartition("test", 0, sarama.OffsetOldest) |
| 264 | if err != nil { |
| 265 | t.Error(err) |
| 266 | } |
| 267 | |
| 268 | // consume first and second error, |
| 269 | <-pc.Errors() |
| 270 | <-pc.Errors() |
| 271 | |
| 272 | if err := consumer.Close(); err != nil { |
| 273 | t.Error(err) |
| 274 | } |
| 275 | |
| 276 | if len(trm.errors) != 0 { |
| 277 | t.Errorf("Expected no expectation failures to be set on the error reporter.") |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | func TestConsumerTopicMetadata(t *testing.T) { |
| 282 | trm := newTestReporterMock() |
nothing calls this directly
no test coverage detected