All Projects → mockito → Mockito Kotlin

mockito / Mockito Kotlin

Licence: mit
Using Mockito with Kotlin

Programming Languages

kotlin
9241 projects
shell
77523 projects

Projects that are alternatives of or similar to Mockito Kotlin

AndroidMVPArchitecture
Android MVP architecture sample project with or without RxJava and Dagger2 and Kotlin
Stars: ✭ 78 (-97.16%)
Mutual labels:  mockito, mockito-kotlin
TestIt
Generate unit testing boilerplate from kotlin files.
Stars: ✭ 32 (-98.84%)
Mutual labels:  mockito, mockito-kotlin
Githubprojectbrowser
This is a sample Android Project that is based on Clean Architecture
Stars: ✭ 64 (-97.67%)
Mutual labels:  mockito
Mocktail
A mock library for Dart inspired by mockito
Stars: ✭ 172 (-93.74%)
Mutual labels:  mockito
Cuckoo
Boilerplate-free mocking framework for Swift!
Stars: ✭ 1,344 (-51.09%)
Mutual labels:  mockito
Android App Architecture Mvvm Databinding
A simple but complete project (in both Java & Kotlin) to demonstrate the Android application architecture with MVVM pattern, a client app for The Movie DB Web API. Dagger2 is used for dependency injection and RxJava is used for RFP (Reactive Functional Programming).
Stars: ✭ 69 (-97.49%)
Mutual labels:  mockito
Refactoring Android App Series Overview
Overview of wonderful series started by Oday and Rakesh for refactoring android application under youtube channel Dry Code.
Stars: ✭ 101 (-96.32%)
Mutual labels:  mockito
Tdcapp
Sample app which access the TDC (The Developer's Conference) REST API.
Stars: ✭ 55 (-98%)
Mutual labels:  mockito
Marvel
Marvel Characters Android Application Assigned by smava GmbH
Stars: ✭ 227 (-91.74%)
Mutual labels:  mockito
Mvpandroid
Sample app to demonstrate MVP (Model - View - Presenter) architecture in android
Stars: ✭ 91 (-96.69%)
Mutual labels:  mockito
Mockito
Most popular Mocking framework for unit tests written in Java
Stars: ✭ 12,453 (+353.17%)
Mutual labels:  mockito
Ribot Android Boilerplate Kotlin
Kotlin version of android boilerplate app that showcases architecture and libraries used at ribot http://ribot.co.uk
Stars: ✭ 85 (-96.91%)
Mutual labels:  mockito
Spring Boot Oauth2 Jwt Swagger Ui
Spring Boot , OAuth 2 , JWT (Json Web Token) and Swagger UI
Stars: ✭ 77 (-97.2%)
Mutual labels:  mockito
Newandroidarchitecture
New Android Architecture showing how to use Dagger Android libs with MVVM
Stars: ✭ 110 (-96%)
Mutual labels:  mockito
Daggermock
A JUnit rule to easily override Dagger 2 objects
Stars: ✭ 1,156 (-57.93%)
Mutual labels:  mockito
Android Mvp Architecture
🏛 A basic sample android application to understand MVP in a very simple way. Just clone, build, run and understand MVP.
Stars: ✭ 203 (-92.61%)
Mutual labels:  mockito
Android tmdb clean architecture
Showcase of clean architecture concepts along with Continuous Integration and Development for modular Android applications. Includes test suits (functional and unit tests) along with code coverage.
Stars: ✭ 63 (-97.71%)
Mutual labels:  mockito
Mockito Java8
Mockito add-ons leveraging Java 8 and lambda expressions to make mocking even more compact
Stars: ✭ 82 (-97.02%)
Mutual labels:  mockito
Kotlinunittesting
Kotlin Unit Testing Examples
Stars: ✭ 99 (-96.4%)
Mutual labels:  mockito
Mockito Scala
Mockito for Scala language
Stars: ✭ 231 (-91.59%)
Mutual labels:  mockito

Mockito-Kotlin

Download Nexus Snapshot

A small library that provides helper functions to work with Mockito in Kotlin.

Install

Mockito-Kotlin is available on Maven Central. For Gradle users, add the following to your build.gradle, replacing x.x.x with the latest version:

testImplementation "org.mockito.kotlin:mockito-kotlin:x.x.x"

Example

A test using Mockito-Kotlin typically looks like the following:

@Test
fun doAction_doesSomething(){ 
  /* Given */
  val mock = mock<MyClass> {
    on { getText() } doReturn "text"
  }
  val classUnderTest = ClassUnderTest(mock)
  
  /* When */
  classUnderTest.doAction()
  
  /* Then */
  verify(mock).doSomething(any())
}

For more info and samples, see the Wiki.

Building

Mockito-Kotlin is built with Gradle.

  • ./gradlew build builds and tests the project
  • ./gradlew publishToMavenLocal installs the maven artifacts in your local repository
  • ./gradlew check runs the test suite (See Testing below)

Versioning

Mockito-Kotlin roughly follows SEMVER

Testing

Mockito-Kotlin's test suite is located in a separate tests module, to allow running the tests using several Kotlin versions whilst still keeping the base module at a recent version.

  • ./gradlew check runs the checks including tests.

Usually it is enough to test only using the default Kotlin versions; CI will test against multiple versions. If you want to test using a different Kotlin version locally, set an environment variable KOTLIN_VERSION and run the tests.

Acknowledgements

mockito-kotlin was created and developed by nhaarman@ after which the repository was integrated into the official Mockito GitHub organization. We would like to thank Niek for the original idea and extensive work plus support that went into mockito-kotlin.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].