(t *testing.T)
| 356 | } |
| 357 | |
| 358 | func TestSyncProducerInvalidConfiguration(t *testing.T) { |
| 359 | trm := newTestReporterMock() |
| 360 | config := NewTestConfig() |
| 361 | config.Version = sarama.V0_11_0_2 |
| 362 | config.ClientID = "not a valid producer ID" |
| 363 | mp := NewSyncProducer(trm, config) |
| 364 | if err := mp.Close(); err != nil { |
| 365 | t.Error(err) |
| 366 | } |
| 367 | |
| 368 | if len(trm.errors) != 1 { |
| 369 | t.Error("Expected to report a single error") |
| 370 | } else if !strings.Contains(trm.errors[0], `ClientID value "not a valid producer ID" is not valid for Kafka versions before 1.0.0`) { |
| 371 | t.Errorf("Unexpected error: %s", trm.errors[0]) |
| 372 | } |
| 373 | } |
nothing calls this directly
no test coverage detected