Skip to content
Joshua Selbo edited this page Nov 18, 2025 · 17 revisions

General FAQs


General

Q: Will this library help mocking closed (non-open) classes?

A: In Kotlin, all classes not explicitly marked with open are final on the JVM. As of Mockito 5.0, the inline mock maker is the default, and this supports mocking final classes. Prior to Mockito 5, add the org.mockito:mockito-inline artifact to your build to enable the inline mock maker.

Q: Will this library help overcoming NullPointerExceptions with Mockito.any()?

A: Passing Mockito.any() to a non-nullable parameter in Kotlin fails with a NullPointerException. See Parameter specified as non-null is null.

Q: I get an error ‘Resolved versions for app (1.1.x) and test app (1.0.x) differ’. What should I do?

A: See Conflict with dependency

Q: Will this library support Mockito 1.x?

A: No. Mockito 2.x is officially released and this library will focus on these versions.