0

Capture Argument Passed to a mock’s method in Mockito

Capture Argument

Sometimes verifying whether or not a method was invoked is not enough.  Some scenarios need verifying values passed to mock object’s methods. To do this, we use:

Here is sample usage:

Download the Codes

https://github.com/Turreta/VoidMethodsAndMockito

I added a new test case in com.turreta.mockito.voidmethod.VoidMethodClassTest.

Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert