mockito-kotlin v2.0.0-RC1 Release Notes

Release Date: 2018-06-21 // about 2 years ago
  • 🔖 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-RC1'

    🚚 If you included a dependency on kotlin-reflect for Mockito-Kotlin only, you can remove it.

    🔄 Changes since 2.0.0-alpha04:

    • ⚡️ Updates Mockito to 2.19.0
    • 👌 Support mocking with constructor arguments. This breaks code that currently uses useConstructor = true, which can simply be replaced by useConstructor = parameterless(). (#266)