What is JUnit Jupiter?

What is JUnit Jupiter?

Hi Matthew,

The JUnit Jupiter test is a new version of the JUnit test that can be used for testing Java applications. JUnit is a popular unit testing framework for Java. It allows us to write tests in a clean and readable format so that we can properly test our code and catch any bugs or errors before our software is used by real users.

The main difference between the JUnit 4 and JUnit 5 tests is that in the new version of the framework, there are more methods available for use in the tests. For example, in previous versions of the framework, there were only two methods available: assertEquals() and assertFalse(). Now there are many more methods available including assertArrayEquals(), assertNotNull(), assertTrue(), assertFalse(), and so on.

Another big change with JUnit 5 is how it handles exceptions. In previous versions of the framework, if you wanted to catch an exception thrown by a method, then you had to manually call getMessage() on the exception object after catching it. Now all we need to do is use one of these newer methods such as expectThrown() or expectThrownBy().

To know how to run JUnit tests in Jupiter, please go through the following article:

2 Likes