# How to mock final classes on Kotlin using Mockito 2 (KAD 23)

DevFeed: [How to mock final classes on Kotlin using Mockito 2 (KAD 23)](<https://devfeed.tech/articles/how-to-mock-final-classes-on-kotlin-using-mockito-2-kad-23-27203.md>)

Original publisher: [Read original article](<https://antonioleiva.com/mockito-2-kotlin>)

Published: 2017-05-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Antonio Leiva](<https://devfeed.tech/sources/antonio-leiva.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Mocking](<https://devfeed.tech/topics/mocking.md>), [Testing](<https://devfeed.tech/topics/testing.md>)

Tags: [2](<https://devfeed.tech/tags/2.md>), [classes](<https://devfeed.tech/tags/classes.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [mocking](<https://devfeed.tech/tags/mocking.md>), [mockito](<https://devfeed.tech/tags/mockito.md>), [testing](<https://devfeed.tech/tags/testing.md>)

## AI overview

This tutorial explains how to mock final Kotlin classes with Mockito 2. It covers updating the Mockito dependency, enabling experimental support for final-class mocking through a configuration file, and mocking Kotlin properties.

## Source excerpt

Everything Android, Kotlin and other random topics