Search code examples
scalaautomated-testsakkascalatest

Using ScalaTest to test akka actors


I am struggling to find any ScalaTest samples written using FunSuite testing an akka actor.

I appreciate if somebody could provide a simple scalatest example testing a simple akka actor.


Solution

  • Akka is very well documented. You can find the documentation here. Here is the link to the Testing Actor Systems (Scala) chapter, which comes with an example.

    Note: The full example uses a ScalaTest WordSpec. For a FunSuite example, change WordSpec to FunSuite and write tests with test("test name") rather than WordSpec's should/in style. All else will be identical to the example shown.