Migrating from Mockito
Learn how to use MockK by seeing equivalents to functions in Mockito.
The similarities and differences in creating mocks between Mockito and MockK.
when(x).thenReturn(y)
, doReturn
, and more.
Mockito’s eq
, refEq
, and same
argument matchers.
The “any” family of matchers: any
, anyBoolean
, anyByte
, anyChar
, anyDouble
, anyFloat
, anyInt
, anyLong
, anyObject
, anyShort
, and anyString
.
verify
that a method was called.
Porting custom matchers with argThat
Capturing arguments to check them later.
MockK makes it easier to mock methods that return void
.
当前内容版权归 Tiger Oakes 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 Tiger Oakes .