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

Function TestConsumerUnexpectedTopicMetadata

mocks/consumer_test.go:324–335  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

322}
323
324func TestConsumerUnexpectedTopicMetadata(t *testing.T) {
325 trm := newTestReporterMock()
326 consumer := NewConsumer(trm, NewTestConfig())
327
328 if _, err := consumer.Topics(); !errors.Is(err, sarama.ErrOutOfBrokers) {
329 t.Error("Expected sarama.ErrOutOfBrokers, found", err)
330 }
331
332 if len(trm.errors) != 1 {
333 t.Errorf("Expected an expectation failure to be set on the error reporter.")
334 }
335}
336
337func TestConsumerOffsetsAreManagedCorrectlyWithOffsetOldest(t *testing.T) {
338 trm := newTestReporterMock()

Callers

nothing calls this directly

Calls 7

TopicsMethod · 0.95
newTestReporterMockFunction · 0.85
IsMethod · 0.80
NewConsumerFunction · 0.70
NewTestConfigFunction · 0.70
ErrorMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected