Chapter 2. Groovy knowledge for Spock testing

This chapter covers

  • Understanding the connection between Java and Groovy
  • Learning Groovy conventions
  • Comparing JUnit asserts and Groovy power asserts
  • Using Groovy utilities for common testing needs
  • Obtaining test data with Groovy

Learning a new programming language is usually a daunting task. You must study a new syntax, new concepts, and new libraries all at once to be productive. If you’ve spent too many years with a single language, several concepts are so entrenched that having to “unlearn” them poses a big barrier to any alternative (even if it’s objectively better). With Groovy, this isn’t the case because Groovy is a cousin language to Java. Much of your current knowledge can be reused and ...

Get Java Testing with Spock now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.