trait MockKafkaProducer extends AnyRef
Defines methods for a mock kafka producer: allows for checking for test messages and provides a MkProducer instance. Keeps an internal offset for each topic so that messages can be consumed one by one with convenience methods.
- Alphabetic
- By Inheritance
- MockKafkaProducer
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def historyFor[K, V](topic: String, key: K)(implicit arg0: Eq[K], keyDeserializer: KeyDeserializer[IO, K], valueDeserializer: ValueDeserializer[IO, V]): IO[List[V]]
Returns the list of published messages for the given topic and key.
Returns the list of published messages for the given topic and key.
- K
the key type
- V
the value type
- topic
the topic to get the history for
- key
the key to get the history for
- keyDeserializer
the key deserializer
- valueDeserializer
the value deserializer
- returns
the list of published messages thus far
- abstract def historyFor[K, V](topic: String)(implicit keyDeserializer: KeyDeserializer[IO, K], valueDeserializer: ValueDeserializer[IO, V]): IO[List[(K, V)]]
Returns the list of published messages for the given topic.
Returns the list of published messages for the given topic.
- K
the key type
- V
the value type
- topic
the topic to get the history for
- keyDeserializer
the key deserializer
- valueDeserializer
the value deserializer
- returns
the list of published messages thus far
- implicit abstract def mkProducer: MkProducer[IO]
MkProducer instance providing the mock producer.
MkProducer instance providing the mock producer. Including this instance in implicit scope where the kafka producer is created will feed it with the mock producer instance instead of the real one
- abstract def nextEventualMessageFor[K, V](topic: String)(implicit patience: Patience, keyDeserializer: KeyDeserializer[IO, K], valueDeserializer: ValueDeserializer[IO, V]): IO[(K, V)]
Returns the next message for the given topic.
Returns the next message for the given topic. Semantically blocks, with polling intervals and timeout specified with the patience implicit parameter
- topic
the topic to get the next message for
- patience
the patience to use for polling for the next message
- keyDeserializer
the key deserializer
- valueDeserializer
the value deserializer
- Exceptions thrown
`NoSuchElementException`
if no message is available before the timeout
- abstract def nextEventualValueFor[K, V](topic: String, key: K)(implicit arg0: Eq[K], patience: Patience, keyDeserializer: KeyDeserializer[IO, K], valueDeserializer: ValueDeserializer[IO, V]): IO[V]
Returns the next message for the given topic and key.
Returns the next message for the given topic and key. Semantically blocks, with polling intervals and timeout specified with the patience implicit parameter
- topic
the topic to get the next message for
- key
the key to get the next message for
- patience
the patience to use for polling for the next message
- keyDeserializer
the key deserializer
- valueDeserializer
the value deserializer
- Exceptions thrown
`NoSuchElementException`
if no message is available before the timeout
- abstract def nextMessageFor[K, V](topic: String)(implicit keyDeserializer: KeyDeserializer[IO, K], valueDeserializer: ValueDeserializer[IO, V]): IO[Option[(K, V)]]
Returns the next message for the given topic, if any.
Returns the next message for the given topic, if any. Increments the internal offset for the topic.
- K
the key type
- V
the value type
- topic
the topic to get the next message for
- keyDeserializer
the key deserializer
- valueDeserializer
the value deserializer
- returns
the next message for the given topic, if any
- abstract def nextValueFor[K, V](topic: String, key: K)(implicit arg0: Eq[K], keyDeserializer: KeyDeserializer[IO, K], valueDeserializer: ValueDeserializer[IO, V]): IO[Option[V]]
Returns the next message for the given topic and key, if any.
Returns the next message for the given topic and key, if any. Increments the internal offset for the topic.
- K
the key type
- V
the value type
- topic
the topic to get the next message for
- key
the key to get the next message for
- keyDeserializer
the key deserializer
- valueDeserializer
the value deserializer
- returns
the next message for the given topic and key, if any
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)