As before, we would like to conclude our journey by testing the implementation we came up with. Luckily, Lightbend follows the same approach to testing as it did with other libraries. There is a test kit that allows us to test services and persistent entities easily. We'll demonstrate how to test services in this section and leave testing persistent entities as an exercise for the reader.
It makes sense to start by testing the simplest service we defined—CookService. Here is a test for it, placed in the test scope of the cook-impl module:
import ch15.model.Dough
import com.lightbend.lagom.scaladsl.server.LocalServiceLocator
import com.lightbend.lagom.scaladsl.testkit.ServiceTest
import org.scalatest.{AsyncWordSpec, Matchers}
import play.api.libs.ws.ahc.AhcWSComponents
class CookServiceSpec extends AsyncWordSpec with Matchers {
"The CookService" should...