Search⌘ K

Using Life Cycle Callback Extensions

Learn to use life cycle callback extensions.

Life cycle callback extensions allow us to run the code during the life cycle phase of a test.

The following are the different phases that comprise the life cycle of a JUnit Test.

  • BeforeAll
  • BeforeEach
  • Test Method
  • AfterEach
  • AfterAll

Jupiter provides an extension interface for each of the above mentioned test life cycle stages:

  • BeforeAllCallback is executed before the @BeforeAll method.

  • AfterAllCallback is executed after the @AfterAll ...