Skip to main content

ADR 007: JUnit 5 for unit tests

Status: accepted

Context​

Unit tests used JUnit 4. Moving to JUnit 5 was considered for its new features and better extensibility.

Decision​

All unit tests use JUnit 5.

  • Features. A modular architecture, richer annotations and better support for parameterized tests.
  • Compatibility. Works with Quarkus and Vert.x.
  • Extensibility. A dedicated extension API.

Consequences​

Benefits

  • Better tests thanks to the new features.
  • Better handling of parameterized and conditional tests.
  • Room for future needs.

Costs

  • Existing tests have to be migrated from JUnit 4.
  • A learning curve for the development team.

Alternatives considered​

  • Staying on JUnit 4. Less migration work, without the new features and extensibility.
  • TestNG. A popular alternative, requiring a larger rework and a different learning curve.