Depending on code complexity it is sometimes difficult to write useful and safe Java unit tests. In this video tutorial we introduce the Custom Test Setup technique Developed by Diffblue. This is a technique which combines the power of Diffblue Cover with the inheritance mechanisms of the JUnit and TestNG Frameworks, in order to appropriately configure and clean up the environment, such that unit tests can be usefully and safely written.
Source Code: To follow this tutorial open the CustomTestSetup project from https://github.com/diffblue/tutorials
00:00 Introduction
04:28 Custom Base Class
06:18 BeforeAll
09:36 BeforeEach
13:27 AfterAll
16:55 AfterEach
21:10 Other Uses - Mocking
26:27 Other Uses - Field Inputs
29:57 Conclusions
30:26 End