Test code using JUnit in JVM – tutorial

Edit pageLast modified: 07 February 2025

This tutorial shows you how to write a simple unit test in a Kotlin/JVM project and run it with the Gradle build tool.

In this project, you'll use the kotlin.test library and run the test using JUnit. If you're working on a multiplatform app, see the Kotlin Multiplatform tutorial.

To get started, first download and install the latest version of IntelliJ IDEA.