Skip to content

Releases: mockito/mockito-kotlin

2.0.0-alpha01

30 Nov 22:49

Choose a tag to compare

2.0.0-alpha01 Pre-release
Pre-release

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-reflect anymore. This solves a few conflict issues when using different Kotlin versions. The artifact mockito-kotlin-kt1.1 is therefore dropped.
    • This removes the creation of arbitrary instances through reflection, which was not necessary anyway due to the T as null quirk.

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

03 Jun 15:26

Choose a tag to compare

  • same() now returns T instead of T?
  • Updates Mockito to 2.8.9
  • Introduces a new artifact for usage with Kotlin 1.1.x:
compile 'com.nhaarman:mockito-kotlin-kt1.1:x.x.x'

1.4.0

01 Apr 17:57

Choose a tag to compare

  • Adds an extension function to stub a mock after its creation ( #158 )
  • Updates Mockito to 2.7.21
  • Updates Kotlin to 1.0.7

1.3.0

01 Apr 17:37

Choose a tag to compare

  • Updates Mockito to 2.7.5
  • Adds doAnswer to OngoingStubbing ( #152 )

1.2.0

01 Apr 17:37

Choose a tag to compare

  • Updates Mockito to 2.6.5
  • Introduces an enhanced settings API ( #149 ); see #148.

1.1.0

27 Dec 19:18

Choose a tag to compare

  • Updates Mockito to 2.4.5
  • Updates Kotlin to 1.0.6
  • Adds argWhere ( #141 )
  • Adds BDDMockito functions ( #142 )

1.0.1

12 Dec 18:55

Choose a tag to compare

  • Properly handles null values in argument matchers ( #133 )
  • Throws a descriptive error when null is passed to the check function ( #134 )

1.0.0

06 Dec 12:35

Choose a tag to compare

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.

1.0.0-RC1

06 Dec 12:39

Choose a tag to compare

This is the first and possibly only release candidate for Mockito-Kotlin 1.0.0.

Changes in this version:

  • Removes any deprecated methods.

0.12.0

06 Dec 12:39

Choose a tag to compare

  • isA() returns a non-null instance