This page provides a script which converts your existing JUnit 5 assertions to AssertJ ones. Note that both types of assertions can coexist, you don't have to migrate all at once.
The idea is to convert code like :
See the JUnit 4 Assertions Migration Guide for more information. This script is a copy of JUnit 4 script with few necessary modifications.
Currently there is only OSX script available for JUnit 5 :
Usage : On OSX execute the script in the base directory containing the test files :
# in the directory containing the test files convert-junit5-assertions-to-assertj-on-osx.sh
It is not perfect but should do most of the job. After executing it, you will need to :
The script handles the cases where you use an assertion description, for example :
will be replaced by :
assertEquals("a", "a", "test context");