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.
We'll cover the following...
We'll cover the following...
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.
JUnit5 (Java 1.8)
package io.educative.junit5;import org.junit.jupiter.api.Test;class FirstTest {@Testvoid firstTest() {System.out.println("First Test");}}
Characteristics of a test class
A test class has the following characteristics:
- In JUnit 4, it’s mandatory