I want to check if any method is called on a mock, the mock contains many method and i don't want to write many call in that way:
verify(mock).method1();
verify(mock).method2();
I want to check if any method is called on a mock, the mock contains many method and i don't want to write many call in that way:
verify(mock).method1();
verify(mock).method2();
For the moment I'am using this hack, waiting to find a better solution:
boolean isThereAnyInerraction= false;
try {
Mockito.verifyZeroInteractions(maock);
} catch(NoInteractionsWanted e){
isThereAnyInerraction = true;
}
assertThat(isThereAnyInerraction).isTrue();
The method verifyZeroInteractions(mock)
as it's name, verifies that no method is invoked on a mock.