私は最初のAkkaテストを書いて、ドキュメントを調べようとしています。私はそれの非常に最初のexampleを実行すると、次のエラーを取得したAkka Test TCPコマンドが失敗しました
override def receive: Receive = {
case p: ProducerRecord[_,_] =>
sendChannel.send(p.value())
case _ => logger.error("Unknown type Producer Record Received.")
}
Testspec:
以下[ERROR] [10/26/2017 14:08:55.371] [IngestionWorkerActorSpec-akka.actor.default-dispatcher-4] [akka://IngestionWorkerActorSpec/user/$b] Assertion failed: timeout (3 seconds) during expectMsg while waiting for Test message java.lang.AssertionError: assertion failed: timeout (3 seconds) during expectMsg while waiting for Test message
は私のテスト俳優の受信方法である
val uutActor =system.actorOf(IngestionWorkerActor.props(config, KafkaProducer))
"An actor must send " should {
"send back messages unchanged" in {
uutActor ! expected
Thread.sleep(50)
expectMsg(expected)
}
}
私がしたかったです私の俳優がそれに送られたメッセージを受け取っているかどうかをテストし、後でそのメッセージを修正して、特定のメッセージを受け取っているかどうかを確認したい。どんな助けもありがとうございます。