0
나는 다음과 같은 서명 '프로듀서'라는 클래스를 스텁하려고 : :오버로드 생성자를 가진 클래스 스텁 할 수 없습니다 - Scalamock
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 */ }
}
코드 val fakeProducer = stub[Producer[String, String]]
다음을 오류입니다
나는이 문제를 언젠가 이제 막 고쳤다. 이 스텁 객체를 만들 수있는 방법이 있습니까? 어떤 도움을 주시면 감사하겠습니다.
좋습니다.