MockK Tutorial: How to Mock Kotlin and Android Code
There are hundreds of mocking libraries out there, but if you’re writing Kotlin code then MockK is one of the best around. It’s designed specifically for Kotlin and lets you mock practically any feature you want, without relying on real APIs or external dependencies. MockK has been around since 2017, but if you’re new to Kotlin or mocking libraries you may not have run into it before.