How do I create an expected exception in JUnit 5?
Assertions assertThrows() are used in JUnit 5 for writing the test code with an expectation for throwing an exception. For the provided test, we expect the test code to throw an exception meant for type or subtype of ApplicationException. As for JUnit 4, we should be using @Test(expected = NullPointerException.
Learn further on how to execute JUnit 4 tests with JUnit 5: java - Executing JUnit 4 and JUnit 5 tests in a same build - Stack Overflow