@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.

Get hands-on with 1200+ tech skills courses.