...

/

@Test Annotation

@Test Annotation

In this lesson, we’ll look into a quick review of JUnit’s 5 @Test annotation. This annotation provides a powerful tool for performing unit testing.

Class Under Test

Let’s first create a class with some functionality to test. This class will have the method for which we will write our test scenarios to demonstrate the @Test annotation’s usability. The class name in our example would be - OddEven, as shown in the code below.

Method Under Test

Inside OddEven class, let’s create a method by name isEvenNumber(). This method will take in an integer value and return a ...

Access this course and 1400+ top-rated courses and projects.