Junit the testing library that we rely on in openmrs-core has seen a major release some time ago which is Junit 5.
If you want to understand its architecture and what dependencies we need read
Information on the biggest changes and what needs to be done to migrate from Junit 4.
Junit 4 is still supported but will eventually have an end of life. New developers with some Java experience coming to openmrs from other projects will very likely have written tests in Junit 5 since that is the current version. Junit 5 offers a lot of interesting new feature that openmrs could leverage.
- conditional test execution (based on environment variables, JDK version, ...). This would allow us for example to run integration tests against mysql or postgresql in an environment where they are actually deployed
- tags could be used for tagging tests as integration tests regardless of what their name is. maven-surefire could then use them to filter unit vs integration tests
- parametrized tests can be written next to standard tests
- the new extension model allows us to potentially write our own extensions that can be used alongside spring/mockito extensions (extensions replacing the runners (in Junit 4 only 1 runner per class is allowd) and rules)
IntelliJ enables developers to migrate singe files and even entire projects from Junit 4 to Junit 5.
This video explains how this can be done
This is not only very useful to achieve the migration of openmrs-core but it will also help module developers.