Article cover for Mockito Final Kotlin

How to mock final classes in Kotlin with Mockito?

Let’s consider the following system under test: And following test method: if you are unsure how to use Mockito with Kotlin, check https://kotlintesting.com/using-mockito-in-kotlin-projects/ After running this test it is likely that you will encounter the following error: Classes marked as „final” should not be extended Kotlin default modifier translates to „final” in Java Classes in …

How to mock final classes in Kotlin with Mockito? Read More »