Copyright
Brief Table of Contents
Table of Contents
Foreword
Preface
Acknowledgments
About this Book
About the Cover Illustration
1. Foundations and brief tour of Spock
Chapter 1. Introducing the Spock testing framework
1.1. What is Spock?
1.1.1. Mocking and stubbing
1.1.2. Behavior-driven development
1.1.3. Spock’s design features
1.1.4. Spock’s coding features
1.2. The need for a testing framework
1.2.1. Spock as an enterprise-ready test framework
1.2.2. Common ways to handle enterprise complexity
1.3. Spock: the groovier testing framework
1.3.1. Asserts vs. Assertions
1.3.2. Agnostic testing of Java and Groovy
1.3.3. Taking advantage of Groovy tricks in Spock tests
1.4. Getting an overview of Spock’s main features
1.4.1. Enterprise testing
1.4.2. Data-driven tests
1.4.3. Mocking and stubbing
1.5. A first look at Spock in action
1.5.1. A simple test with JUnit
1.5.2. A simple test with Spock
1.5.3. Inspecting failed tests with Spock
1.6. Spock’s position in the Java ecosystem
1.6.1. Making Spock Groovy
1.6.2. Adding Spock tests to existing projects that have JUnit tests
1.6.3. Spock adoption path in a Java project