O'Reilly logo

Scala Test-Driven Development by Gaurav Sood

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

Mocking frameworks

We will only confine our study to the list of mocking frameworks that are compatible with Scala. There will be similar frameworks or bridge APIs to the same frameworks available for unit testing other languages.

JMock

As the name suggests, JMock was originally written for test-driven development of Java code by providing support for mock objects and stubs. Given that Scala runs on JVM and can use Java classes, it is quite easy to start using JMock when test-driving Scala code.

Moreover, it is also easier for developers who have used JMock with Java to make a transition into writing test-driven Scala code.

Advantages of JMock

The following are JMock advantages:

  • Easier to make a transition from Java to Scala
  • Quite easy to set up and ...

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