DEV Community

Cover image for Top articles on KotlinTesting (2022)
Jarosław
Jarosław

Posted on

3 2

Top articles on KotlinTesting (2022)

1 Using Mockito in Kotlin projects

Refactoring Java Mockito based test suite to Mockito-Kotlin DSL
https://kotlintesting.com/using-mockito-in-kotlin-projects

2 Don't mock static: test SLF4J Loggers with appenders

Do you want to assert that SLF4J actually logged warn with proper message? Check this guide on how to mock logger in tests, in Kotlin and Java.
https://kotlintesting.com/mock-slf4j/

3 Mocking coroutines with MockK

How to easily stub or mock suspend function in Kotlin? MockK is the solution. See MockK examples for mocking coroutines.
https://kotlintesting.com/mocking-suspend-with-mockk/

4 How to mock final classes in Kotlin with Mockito?

Mockito cannot mock/spy because your class is final class? We can fix that.
https://kotlintesting.com/mock-final-in-kotlin/

5 Parameterized tests with Kotest

Creating parameterized tests in Kotlin: data driven testing, collection inspections and generating test cases with FreeSpec.
https://kotlintesting.com/kotest-parameterized/

Sentry mobile image

Tired of users complaining about slow app loading and janky UI?

Improve performance with key strategies like TTID/TTFD & app start analysis.

Read the blog post

Top comments (0)

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay