Test HelloWorld without using DI Controller

In this section, we are going to refer play-scala-helloworld-app Play Scala-based HelloWorld application available in the Chapter-6 folder from the GitHub repository (https://github.com/rposa-srp-book/srp-book-examples/tree/master/Chapter-6/play-scala-helloworld-app) and write unit tests for its controller.

Perform the following steps to write unit tests for this application:

  1. Add the following entry in the build.sbt file available in the root folder of this project:
      libraryDependencies ++= Seq( 
        "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test 
      ) 

Here, we have configured the ScalaTest Plus unit testing framework in the Test scope. It provides all the required components to test ...

Get Scala Reactive Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.