JUnit 5 Basics
Learn how to write and manage tests in Java using JUnit 5, THE most popular testing framework in Java
Introduction and agenda
Why write tests?
Why do we need a testing framework?
Why JUnit 5?
JUnit 5 Architecture
Creating a new JUnit 5 Maven project
Creating a JUnit test
Running a test
The @Test annotation
Using Assertions
Assert methods
Test driven development with JUnit
Maven surefire plugin integration
Asserting exceptions with assertThrows
Life cycle and test antipatterns to avoid
Using JUnit lifecycle hook annotations
Examining BeforeAll and AfterAll
Changing default TestInstance behavior
Using DisplayName and Disabled annotations
Conditional executions and assumptions
Using AssertAll
Writing nested test classes
Using supplier for assert messages
Using RepeatedTest
Tagging tests with @Tag
Using TestInfo and TestReporter
Wrap Up