Change the test display names in JUnit 5
Test names usually tend to become very long and difficult to read. JUnit5 allows us to set custom test display names, different from the test method names.
Testing for exceptions in JUnit 5
Testing for exceptions in JUnit has never been a very straightforward thing. I've often seen it mangled, misused or not well executed, especially in JUnit 4.
Running tests in parallel with JUnit 5
Before JUnit 5 running tests in parallel was not easy. Luckily, now we have JUnit 5, and it has the possibility of running tests in parallel out of the box.
Dynamic tests in JUnit 5
Although not a novelty concept, dynamic tests in the current form were introduced in JUnit 5. The main point of dynamic tests is to demonstrate that users can can generate tests dynamically, at runtime.
Joining JaCoCo JUnit Reports with Gradle
One issue that I ran into when generating JaCoCo reports is that I would get different reports for each of my test tasks. What I needed was to join the reports and get a single report for the overall test coverage of my code.
JUnit test coverage reports using Gradle and JaCoCo
JaCoCo is one the most used tools for generating coverage reports for JUnit tests. One of the reasons for it being so used is it's seamless integration with tools like Jenkins, SonarQube, Maven and Gradle.
Running JUnit 5 tests with Gradle
With Gradle, very little comes out of the box and a lot of the filtering and configuration you need to do on your own. That can be confusing at first especially as a beginner and even more so if you are accustomed to Maven.
Mock final classes with Mockito
One of the standard Mockito related questions I’
Using Mockito with JUnit 5
Since version2.16.3 [https://github.com/mockito/mockito/pull/1221]Mockito has
official support for Junit5. Using Mockito with
JUnit 5 extension model
JUnit 4 extension model is a bit scary. You have @Rule, @ClassRule, and
different Runner implementations. Very often you need