Chapter 8. Spock features for enterprise testing

 

This chapter covers

  • Using Spock annotations that are helpful in enterprise testing
  • Refactoring large Spock tests
  • Testing legacy code with spy objects

One of the good qualities of a flexible software tool is the ability to adapt to any software situation, especially the corner cases that appear in large enterprise projects. Enterprise projects often come in large code bases (think millions of code lines), have an endless stream of requirements, and more often than not contain legacy modules that can’t be changed for political or technical reasons.

Chapter 1 showed that Spock is a holistic testing solution that will cover your needs regardless of the size of the application and whether you work solo or as part of a large team. A bigger code base always amounts to extra complexity on all fronts (compilation, documentation, and delivery), and it’s good to know that Spock has you covered even when your needs are off the beaten path.

8.1. Using additional Spock features for enterprise tests

8.2. Handling large Spock tests

8.3. Creating partial mocks with spies

8.4. Summary