O'Reilly logo

Scala Reactive Programming by Rambabu Posa

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Unit testing Scala applications

In this section, we will discuss how to unit test Scala components using the ScalaTest unit testing framework. Most or all of the Scala-based applications use Case classes to represent their Data Models, so we should learn how to unit test Case classes.

Refer to the scala-fp-app project from Chapter 2Functional Scala, GitHub repository. It contains the following Case class to represent our WF Reactive System data model:

    package com.packt.publishing.caseclass 
    case class WeatherForecast (city: String, date: String, hour:     String, temperature: String) 

Perform the following steps to unit test WeatherForecast data model:

  1. Write unit tests to test each and every data value of this data model using the ScalaTest ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required