I am trying to stub a class called 'Producer' with the following signature:
class Producer[K, V](private val underlying : kafka.producer.Producer[K, V]) extends scala.AnyRef {
def this(config : kafka.producer.ProducerConfig) = { /* compiled code */ }
def send(message : kafka.producer.KeyedMessage[K, V]) : scala.Unit = { /* compiled code */ }
def send(messages : java.util.List[kafka.producer.KeyedMessage[K, V]]) : scala.Unit = { /* compiled code */ }
def close : scala.Unit = { /* compiled code */ }
}
the code val fakeProducer = stub[Producer[String, String]]
I have been stuck with this issue for sometime now. Is there a way we can create this stub object? Any help would be appreciated.
Best Regards.