To demonstrate how the ScalaTest unit-testing library works, we will write a unit test for one actor. Add a ScalaTest test case by right-clicking on src/test/scala and choosing New | Scala Class. Name the QuotesHandlerActorTests class. Remove the generated code and start by defining the required imports and the class definition itself:
import akka.actor.{ActorSystem, Props} import akka.testkit.{TestKit, ImplicitSender, TestActorRef} import org.scalatest.{Matchers, FlatSpecLike, BeforeAndAfterAll} import akkaquote.actor.QuotesHandlerActor import akkaquote.message.{AddQuote, Quote, QuoteAdded} class QuotesHandlerActorTests() extends TestKit(ActorSystem("Tests")) with ImplicitSender with Matchers with FlatSpecLike ...