Unit testing frameworks
We have many unit testing frameworks to test Play, Scala, and Akka-based applications. We can use the following frameworks:
- Spec2
- ScalaTest
- ScalaTest plus
- ScalaCheck
- ScalaMock
- Mokito
- Akka Toolkit's testing modules
In this chapter, we will use mainly ScalaTest, and its related frameworks to test our applications, and also Akka Toolkit's testing modules.
ScalaTest
ScalaTest is one of the popular unit testing frameworks for Scala-based projects. It is an open source, free software released under the Apache 2.0 license, developed by Bill Venners and Artima. It also supports the unit testing of Java-based applications.
It supports multiple testing styles, such as WordSpec, FlatSpec, FreeSpec, and PropSpec. We can choose the right spec to suit our project requirements.
ScalaTest's latest stable version is 3.0.4, and we can find its documentation at http://doc.scalatest.org/3.0.1/#package. Its official website is www.scalatest.org, and its source code is available at https://github...