Learn to write tests which are easy to read and write: get started with Spock Framework.

JUnit 5 – The Ultimate Resource

Migrating From JUnit 4

  • JUnit 5 vs JUnit 4 is a hands-on guide that describes the differences between JUnit 4 and 5. It also provides a list of blog posts that help you to get started with JUnit 5.
  • Migrating from JUnit 4 to JUnit 5 is a practical post that identifies the differences between JUnit 4 to JUnit 5. This information helps you to migrate your existing tests from JUnit 4 to JUnit 5.
  • Migrating to JUnit 5 describes how the author migrated the VocabHunter open source project from JUnit 4 to JUnit 5. This post describes how the author updated his (somewhat complex) Gradle build script and explains how he solved a few other problems such as mocking and passing JVM arguments to his test suite.
  • JUnit 5 User Guide: 6. Migrating from JUnit 4 describes how you can run your existing tests with JUnit 5 and provides tips that help you to make the required changes to your existing tests.
  • Porting Your Existing Tests to JUnit 5 is a hands-on guide that helps you to modify your existing tests to use JUnit 5.

JUnit 5 Architecture

  • JUnit 5 – Architecture is an excellent blog post that provides a comprehensive description of the JUnit 5 architecture. The interesting thing about this blog post is that also describes the reasons behind the design decisions made by JUnit 5 team.

Using Maven and Gradle

Getting Started With JUnit 5

Advanced Topics

  • A Guide to JUnit 5 Extensions provides a quick introduction to the JUnit 5 extension model and describes how you can write your first JUnit 5 extension.
  • JUnit 5 – Conditions is a very comprehensive blog post that describes how you can disable test methods by using conditions.
  • JUnit 5 – Extension Model is an excellent blog post that describes the JUnit 5 extension model. The best part of this blog post is that the author identifies the reasons behind the technical decisions made by the JUnit 5 team.

Extensions