The wheel is an extension of the foot, the book is an extension of the eye, clothing an extension of the skin, electric circuitry an extension of the central nervous system.
In chapter 4, we demonstrated ways to extend the execution of tests. We examined JUnit 4 rules and JUnit 5 extensions face to face, and we analyzed how to migrate from the old JUnit 4 rules to the new extension model developed by JUnit 5. We also emphasized a few well-known extensions, such as MockitoExtension and SpringExtension. In chapter 8, we implemented tests using mock objects and MockitoExtension, and we’ll implement more tests using SpringExtension in chapter 16. In this chapter, we demonstrate the systematic creation of custom extensions and their applicability to creating JUnit 5 tests.