O'Reilly logo

Java Testing with Spock by Konstantinos Kapelonis

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

Chapter 3. A tour of Spock functionality

This chapter covers

  • Understanding the given-when-then Spock syntax
  • Testing datasets with data-driven tests
  • Introducing mocks/stubs with Spock
  • Examining mock behavior

With the Groovy basics out of the way, you’re now ready to focus on Spock syntax and see how it combines several aspects of unit testing in a single and cohesive package.

Different applications come with different testing needs, and it’s hard to predict what parts of Spock will be more useful to you beforehand. This chapter covers a bit of all major Spock capabilities to give you a bird’s-eye view of how Spock works. I won’t focus on all the details yet because these are explained in the coming chapters.

The purpose of this chapter ...

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