(t *testing.T)
| 251 | func (brokePartitioner) RequiresConsistency() bool { return false } |
| 252 | |
| 253 | func TestProducerWithInvalidConfiguration(t *testing.T) { |
| 254 | trm := newTestReporterMock() |
| 255 | config := NewTestConfig() |
| 256 | config.Version = sarama.V0_11_0_2 |
| 257 | config.ClientID = "not a valid producer ID" |
| 258 | mp := NewAsyncProducer(trm, config) |
| 259 | if err := mp.Close(); err != nil { |
| 260 | t.Error(err) |
| 261 | } |
| 262 | if len(trm.errors) != 1 { |
| 263 | t.Error("Expected to report a single error") |
| 264 | } else if !strings.Contains(trm.errors[0], `ClientID value "not a valid producer ID" is not valid for Kafka versions before 1.0.0`) { |
| 265 | t.Errorf("Unexpected error: %s", trm.errors[0]) |
| 266 | } |
| 267 | } |
nothing calls this directly
no test coverage detected