android pro newsletter tips and tricks how to learn android

AndroidPro newsletter 🚀

join 3057 developers reading AndroidPro newsletter every week

👉 tips & tricks, articles, videos

👉 every Thursday in your inbox

🎁 bonus on signup – Clean Architecture blueprint

brought to you by Jarek Michalik, Kotlin GDE

You can unsubscribe any time. For details visit our privacy policy.


Short answer: you don't. Instead...
When it comes to testing in Kotlin, we often default to jUnit as the go-to framework. However, there's an alternative that offers a variety of powerful features – Kotest. Kotest provides a variety of spec styles, each with its unique capabilities, that make writing tests a breeze.
In this article we will explore several ways of creating stubs… using Kotlin idioms.
Are you programming for Android and wondering how to write tests for your app? Or maybe you don't have any tests in your project and don't know how to live? Get to know my philosophy of creating tests for Android.
Examples of de-mocking test code as presented on Droidcon Berlin 2022.
Most of the times while stubbing with Mockito or MockK you will use doReturn construction. But do you know, that you can stub your test double method in other way – with doAnswer. Let's take a look a both stubbing types.
Mockito cannot mock/spy because your class is final class? We can fix that.
When you have existing test suite containing jUni4 tests and you want to migrate slowly to jUnit5 to make use of new APIs and modern test engine, you may encounter some issues – not all tests will be visible in reports.
JVM and Kotlin testing libraries - Gradle dependencies and latest versions.