The core methods of Mockito are called through the class name, where static imports make stubbing and verification read as sentences

tx0/java:qualified-mockito-callstrictwarningmaintainability/testsdepth faststyle

What it finds

Mockito is designed to read as when(repo.find(1)).thenReturn(user) and verify(repo).save(user). Mockito.when and Mockito.verify repeat the class name in every line of a test.

Reported is a call of when, verify, mock, spy, doReturn, doThrow or doNothing on Mockito.

From the rule's source, qualified_mockito_call.rs.

Example from the rule's tests
import org.mockito.Mockito; class StubTest {  void run() {    Repo repo = Mockito.mock(Repo.class);tx0 reports: static import    Mockito.verify(repo).child();tx0 reports: static import  }  interface Repo {    Repo child();  }}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/java:qualified-mockito-call" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/java:qualified-mockito-call] reason="..."

tx0 explain tx0/java:qualified-mockito-call shows the same in the terminal. Found a false positive? Report it.