What is JUnit 5?
JUnit 5 is an open source library and not part of the Java Development Kit library. It is licensed using the Eclipse Public License v2.0. This simply means that you are free to use this library and distribute it with your work for either open source or commercial software without having to make any payments. So, what does it do?
This unit testing framework allows you to instantiate any class in your project and call upon any non-private method. These non-private methods, such as public
and package
, can be executed from within what is called a test class. These are classes that are instantiated by the JUnit framework. A test class contains methods that can instantiate any class in the project and call upon a method in the class.