Using assertNull() and assertNotNull() methods together
This lesson demonstrates how to use assertNull() and assertNotNull() methods together in JUnit 5 to assert test conditions.
We'll cover the following...
We'll cover the following...
Demo
Step 1 - Create a Java class in Eclipse as discussed in previous lessons.
Step 2 - Give it a name as, StringUtils.`
Class Under Test - StringUtils
StringUtils is our class under test. It has one method as, reverse(). This method takes in a String and returns reverse of it.
For example -
-
If we provide input String as, “ABCD”, it returns back “DCBA”.
-
If we provide input String as, “Student”, it returns back “tnedutS”.
-
If we provide input ...