mockito Verify method calls Simple method call verification


Example

One can verify whether a method was called on a mock by using Mockito.verify().

Original mock = Mockito.mock(Original.class);
String param1 = "Expected param value";
int param2 = 100; // Expected param value

//Do something with mock

//Verify if mock was used properly
Mockito.verify(mock).method();
Mockito.verify(mock).methodWithParameters(param1, param2);