mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.09k stars 198 forks source link

Ease verify inOrder for suspending functions #464

Closed seyfahni closed 1 year ago

seyfahni commented 1 year ago

Why?

val stub = mock<SomeInterface>()

runBlocking {
  testWith(stub) // testing suspending code
}

stub.inOrder {
  verify().notSuspending()
  // this "worked" before my change, but didn't verify order
  verifyBlocking { suspending() }
  // instead one had to use runBlocking { verify().suspending() }
  // or val v = verify(); runBlocking { v.suspending() }
}

Changes:

Thank you for submitting a pull request! But first: