Kotlin with Gradle: Null Safety, Data Classes, Collections, Coroutines & JUnit in a Container
Beginner · 45 minutes · 100 points
In this beginner-friendly lab, you will set up a Kotlin + Gradle project inside an eclipse-temurin:17 Docker container, write small Kotlin programs covering null safety, data classes, collections, and coroutines, then validate your work with JUnit tests. By the end you will have a fully working Gradle project that compiles, runs, and passes tests — all inside a reproducible container.
What you’ll learn
- Install Gradle inside an eclipse-temurin:17 container and initialise a Kotlin/JVM project
- Write Kotlin source files demonstrating null safety, data classes, and collection operations
- Add coroutine support and write a suspending function
- Write and run JUnit 5 tests that validate the Kotlin code
How this lab works
- Start the lab: One click starts a container on your computer with a real terminal: nothing to install by hand, nothing to clean up.
- Work through 4 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work runs each task’s checks in your container and says what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Runs: A container on your computer, with a real terminal
- Image: eclipse-temurin:17
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
Topics: kotlin, gradle, jvm, junit, coroutines, docker, devops
Create a free account to start this lab.