Wrapping Up
Automated testing is a key technical practice for sustainable agile development. You may use tools that you’re used to in Java to write automated tests for Kotlin. Alternatively, you may use tools that are targeted specifically for Kotlin, to enjoy fluency and to be able to use idiomatic Kotlin style. In this chapter, we used KotlinTest, Mockk, and Jacoco to write tests, to mock dependencies, and create the code coverage report. In addition, we used Gradle and Maven to run the builds.
KotlinTest provides elegant syntax and fluent asserts, along with many different options to write tests. Mockk is a powerful mocking tool that can be used to stub and mock classes, singletons, companion objects, and top-level functions. Mockk also has ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access