MockitoUsage
Missing method call for verify(mock) here

Category
MOCKITO
Severity
ERROR
Maturity

The problem

Calls to Mockito.when should always be accompanied by a call to a method like thenReturn.

when(mock.get()).thenReturn(answer); // correct
when(mock.get())                     // oops!

Similarly, calls to Mockito.verify should call the verified method outside the call to verify.

verify(mock).execute(); // correct
verify(mock.execute()); // oops!

For more information, see the Mockito documentation.

Suppression

Suppress false positives by adding an @SuppressWarnings("MockitoUsage") annotation to the enclosing element.