Using ScalaTest to Test Actors

I'm struggling to find ScalaTest samples written using FunSuite to test acca-acca.

I appreciate if anyone can provide a simple scalpast example testing a simple acc actor.

+5
source share
2 answers

Akka is very well documented. Here you can find the documentation here . Below is a link to the "Testing Actor" (Scala) section that comes with example .

Note. A complete example uses ScalaTest WordSpec. For the FunSuite example, change WordSpec to FunSuite and write the tests with the test ("test name"), not WordSpec in / in style. All others will be identical to the example shown.

+6
source

If you use FunSuite , you will receive an error message: "FunSuite must be a sign that needs to be mixed." If you want to use it, as in the Akka documentation, but replace WordSpec for the FunSuite test, use FunSuiteLike . Like this:

class ComponentLogicTest() extends TestKit(ActorSystem("ComponentLogicTest")) with ImplicitSender with FunSuiteLike with Matchers with BeforeAndAfterAll {
0
source

All Articles