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/

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more