Releases: mockito/mockito-kotlin
2.0.0-alpha01
Version 2.x will introduce some breaking changes:
- The artifact to include is now
com.nhaarman.mockitokotlin2:mockito-kotlin:x.x.x; - The main package to import from is now
com.nhaarman.mockitokotlin2; - Mockito-Kotlin does not depend on
kotlin-reflectanymore. This solves a few conflict issues when using different Kotlin versions. The artifactmockito-kotlin-kt1.1is therefore dropped.- This removes the creation of arbitrary instances through reflection, which was not necessary anyway due to the
T as nullquirk.
- This removes the creation of arbitrary instances through reflection, which was not necessary anyway due to the
To try this release, use the following:
testCompile 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.0.0-alpha01'
If you included a dependency on kotlin-reflect for Mockito-Kotlin only, you can remove it.
1.5.0
1.4.0
1.3.0
1.2.0
1.1.0
1.0.1
1.0.0
This is the first major release for Mockito-Kotlin.
What is Mockito-Kotlin?
Mockito-Kotlin is a wrapper library around Mockito.
It provides top-level functions to allow for a more idiomatic approach while using Mockito in Kotlin.
Furthermore, Mockito returns null values for calls to method like any(), which can cause NullPointerExceptions when passing them to non-nullable parameters. This library solves that issue by trying to create actual instances to return.
Mockito-Kotlin does not intend to alter any of the functionality that Mockito provides, except in places where crucial for working with Kotlin.
See the Wiki to find out how to work with Mockito-Kotlin.