Top "Mockk" questions

Mockk is a free, open source mocking framework for Kotlin programming language.

kotlin mockk not answer found error

Hi i am trying to mock the response i get from a Single observable that gets returned from retrofit using …

unit-testing kotlin kotlin-android-extensions mockk
Mockk Missing calls inside every { ... } block

I'm stuck trying to mock some stuff with mockk: I have the following setup on gradle root: |-- App (just …

android kotlin mocking mockk
Mock static java methods using Mockk

We are currently working with java with kotlin project, slowly migrating the whole code to the latter. Is it possible …

java unit-testing static kotlin mockk
Using mockk to match any varargs

I'm trying to mock an Android Context to return a string from a resource id. However I have trouble matching …

android kotlin mockk
mocking only one call at a time with mockk

I know that in order to mock how a method responds, you have to use every { instanceX.methodB() } returns "42" I'm …

unit-testing kotlin mockk
MockK - reinitialize mocks for each test

I have some mocks created using: val someService = mockk<SomeService>(relaxed = true) There are multiple tests in the …

mockk
mockk exception - no answer found for

using mockk for testing kotlin function. private val serviceObject = mockk<Service>() private val serviceToBeTested = ServiceToBeTestd(Service) fun test(){ …

kotlin mockk
Kotlin Mockk Error: Missing calls inside verify { ... } block

I already read some issues with this or a similar error message (it is also ocurring for every {}), but none …

android unit-testing kotlin android-testing mockk
How to call a lambda callback with mockk

I create a mock of a class with mockk. On this mock I now call a method that gets a …

kotlin mocking mockk
How do you Mockk a Kotlin top level function?

Mockk allows mocking static functions, but how does one mock a Kotlin top level function? For example, if I have …

kotlin mockk