Since I am currently writing Testcases for my Akka application (http://doc.akka.io/docs/akka/snapshot/scala/testing.html) I was wondering if there is a way to test the interface of an actor. What I mean with that, is that I 'd like to check if the receive method of a target actor handles a message A or no. Imagine the following scenario:
Actor A can handle message b and c. Actor B wants to send mesage b and a to actor A. To ensure that this works out nice, I would like to write a test case that ensures that actor A is processing messages a and b.
It depends on what you want to test.
Since the
receive
method is aPartialFunction
, you can doisDefinedAt
tests like so: