Having created an Akka actor in Play Framework, I now want to test it. However I immediately hit a problem:
- The current Play Scala Testing page contains nothing about testing Actors and uses Specs2 for all examples
- I could find no actor test examples in the Play 2.2.1 source tests, or in the samples (which also use Specs2).
- The Akka actor test page uses ScalaTest, and the Akka system setup appears different from that used by the Play application itself.
- The Akka actor test does discuss workarounds for problems using Specs2, but without providing a worked example of such a test, and certainly not one using Play's built-in test fixtures.
Can anyone provide a canonical example of testing an Akka actor using TestKit and Play's test fixtures?
For consistency's sake I would prefer it to use Specs2 (frankly, it seems bizarre to require two different testing frameworks for a single app) however I will accept a ScalaTest example if it integrates well with the Play test fixtures.