import io.mockk.mockk
import io.mockk.verify
import org.junit.jupiter.api.Test
class Test {
@Test
fun `it should pass`() {
val view: View = mockk(relaxUnitFun = true)
verify { view.showLoading() }
}
}
Verify interactions on mocks created with MockK - when you need to check if some action on given object was executed. Syntax is very similar to Mockito.
Enjoy KotlinTesting.com quick tips?
Share it to fellow developers on social media!