In the chapters so far, we bootstrapped our application using Activator, developed our web application using Scala and the Play framework, and added a Reactive microservice call using RxScala for data flow computations. Now we will go ahead and enter the unit test and controller testing using the BDD and Play framework.
In this chapter, we will cover the following topics:
Unit testing principles
Testing Scala applications with JUnit
Behavior-driven development principles
Testing with ScalaTest
Testing Play framework applications with ScalaTest
Running tests in Activator / SBT
The need for testingTest
is a fundamental and very important part of software development. Without tests, we cannot be sure that our code works. We should perform tests on almost all the code we produce. There are things that don't make sense for testing, for instance, case classes and classes that just represent structural objects, or, in other words, classes without functions. If you have...