Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在测试时对 Akka 中的死信作出断言?我有一个演员可以切换行为(使用become)并处理使用单独的调度程序调度的一些期货。在某些特定情况下,它应该简单地拒绝其他消息。那些正确地去死信,但我想尝试为他们断言(或缺乏)。我怎样才能做到这一点?
become
死信是使用事件流传递的,因此您可以在测试中通过探测订阅它并验证消息或缺少消息
system.eventStream.subscribe(probe, classOf[DeadLetter])