...

/

Our First Unit Test with JUnit 5

Our First Unit Test with JUnit 5

Learn to create unit tests with JUnit 5, and learn the characteristics of a test class and method.

Creating our first JUnit test

We usually use test classes to interact with JUnit 5.

We usually use test classes to interact with JUnit 5. Let’s get a deeper understanding of a test class.

Press + to interact
package io.educative.junit5;
import org.junit.jupiter.api.Test;
class FirstTest {
@Test
void firstTest() {
System.out.println("First Test");
}
}

Characteristics of a test class

A test class has the following characteristics:

  • In JUnit 4, it’s mandatory
...