Using Mockito in Java how to verify a method was called only once with exact parameters ignoring calls to other methods?
Sample code:
public class Mo
The previous answer can be simplified even further.
Mockito.verify(foo).add("1"); Mockito.verify(foo).add(Mockito.anyString());
The single parameter verify method is just an alias to the times(1)implementation.
verify
times(1)