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

Method ExpectInputWithCheckerFunctionAndSucceed

mocks/async_producer.go:246–250  ·  view source on GitHub ↗

ExpectInputWithCheckerFunctionAndSucceed sets an expectation on the mock producer that a message will be provided on the input channel. The mock producer will call the given function to check the message value. If an error is returned it will be made available on the Errors channel otherwise the moc

(cf ValueChecker)

Source from the content-addressed store, hash-verified

244// otherwise the mock will handle the message as if it produced successfully, i.e. it will make
245// it available on the Successes channel if the Producer.Return.Successes setting is set to true.
246func (mp *AsyncProducer) ExpectInputWithCheckerFunctionAndSucceed(cf ValueChecker) *AsyncProducer {
247 mp.ExpectInputWithMessageCheckerFunctionAndSucceed(messageValueChecker(cf))
248
249 return mp
250}
251
252// ExpectInputWithCheckerFunctionAndFail sets an expectation on the mock producer that a message
253// will be provided on the input channel. The mock producer will first call the given function to

Callers 1

Implementers 2

asyncProducerasync_producer.go
AsyncProducermocks/async_producer.go

Tested by 1