Mock constructors in code you don’t own Unmocking Mock constructors in code you don’t own Sometimes your classes have dependencies that they construct themselves. While it’s be...
ArgumentCaptor Inline assertions ArgumentCaptor When you need to run additional assertions on an argument, the ArgumentCaptor is the tool for the job in Mockito. An Argument...
Why use mocks Why use mocks How do you make sure your code runs like it’s supposed to? You can start out building your app, playing around with it, and trying buttons while ensu...
eq eq By default, Mockito verifies argument values by using the equals() method, which corresponds to == in Kotlin. verify ( mock . containsAll ( listOf ( "a" , "b" ), ...
any* any* When creating a stub or verifying a call, Mockito provides many different argument matchers. Besides eq , the most commonly used are the “any” family: any , anyBoole...
Comparables more less cmpEq range Comparables less more range cmpEq MockK provides a few argument matchers for numbers and comparable objects. These matches all us...