JUnit 5

JUnit 5 is the next version of Java’s most ubiquitous testing framework.

Its incremental improvements and extensible design make it a worthy successor of the battle-tested JUnit 4. But its secret power is its thoughtful architecture, which may very well redefine the future of testing on the JVM.

A series of posts covers all the details – obvious and hidden ones – of JUnit 5. If you want to learn more about the topic, you can hire me as a trainer.

JUnit 5 - Conditions

We recently learned about JUnit 5’s extension model in general. Let’s now have a detailed look at custom conditions, which allow us to flexibly disable test methods.

JUnit 5 - Extension Model

The JUnit 5 extension model enables detailed, flexible, and powerful additions to JUnit 5’s core features. For that it provides specific extension points and easy composition of annotations.

JUnit 5 - Basics

Get to know the basics of JUnit 5: the lifecycle; how to disable, nest, and name tests; and what’s new with Assertions and Assumptions. Let’s write some tests!

JUnit 5 - Architecture

JUnit 4 came in a single artifact, blending all uses cases into one bundle. The JUnit 5 architecture promotes a better separation of concerns and provides a clear API for IDEs, build tools, etc. to work with.