(t *testing.T)
| 405 | } |
| 406 | |
| 407 | func TestConsumerInvalidConfiguration(t *testing.T) { |
| 408 | trm := newTestReporterMock() |
| 409 | config := NewTestConfig() |
| 410 | config.Version = sarama.V0_11_0_2 |
| 411 | config.ClientID = "not a valid consumer ID" |
| 412 | consumer := NewConsumer(trm, config) |
| 413 | if err := consumer.Close(); err != nil { |
| 414 | t.Error(err) |
| 415 | } |
| 416 | |
| 417 | if len(trm.errors) != 1 { |
| 418 | t.Error("Expected to report a single error") |
| 419 | } else if !strings.Contains(trm.errors[0], `ClientID value "not a valid consumer ID" is not valid for Kafka versions before 1.0.0`) { |
| 420 | t.Errorf("Unexpected error: %s", trm.errors[0]) |
| 421 | } |
| 422 | } |
nothing calls this directly
no test coverage detected