JUnit 5 course

A practical course from the first test class to a suite that covers a small application. Every lesson is a manual: a complete class under test, a complete test class, the two commands that compile and run them, and the report the launcher printed on the machine described at the end of the lesson. The course is written and published part by part, and the tree below lists the lessons that are ready to read.

The first part sets up the launcher and reads its report. Assertions come next, then the lifecycle that gives every test a fresh fixture, parameterised and repeated tests, exceptions and timeouts, temporary folders and files. The last parts organise a suite with tags and suites and build a task tracker whose tests are written one piece at a time.

Start with What JUnit 5 is and the launcher jar. For the shortest working example read Testing Java code with the JUnit launcher, and for the language itself open the Java hub.

Lessons

Click a part of the course to open or close its lessons.