The Groovy Way of Testing with Spock
summary
Argues Spock delivers clearer, shorter tests by using Groovy features such as given-when-then structure, Groovy power asserts that show exact expression differences, and concise data tables for parameterized cases. Shows mocking without extra libraries, verifying interaction counts and returning values to drive branches (example: mocking audienceCountService to return 200 so popularity >100 passes). Demonstrates built-in mocking, stepwise ordered journey tests, and how Spock test classes can co-exist with JUnit engines.
AI-written summary · about
chapters (13)
- 0:00Introduction and motivation
- 3:41Clear intention in test names
- 6:32BDD style with given-when-then
- 10:04Power asserts for better errors
- 16:21Data-driven testing with where
- 18:26Ordered test execution
- 19:51Built-in mocking in Spock
- 22:20JUnit 4 compatibility
- 23:45JUnit 5 and Spock integration
- 26:12Shared test instances
- 31:21Built-in mocking advantages
- 32:11Groovy productivity with Spock
- 33:40Q&A and closing
related talks
46mEasy testing with Spock
29mWhy I prefer Spock over JUnit
18mSpeedup unit testing with the Spock framework
45mWhy Use Spock Instead of JUnit Mockito for Your Java Tests
01h 17mTesting Java, Groovy, Spring and Web Applications with Spock
49mFabulous Tests with Spock and Groovy
01h 12mUnit Tests as a Specification
51mSpock Framework: The Ultimate Framework for Testing Your Java Applications
