JUnit 5 Lifecycle

Introduction and annotations.

Introduction

  • How JUnit's lifecycle works.
  • @BeforeEach / @AfterEach: Running something before/after every test method.
  • @BeforeAll / @AfterAll: Running something once before/after a test class.