- SonarQube for IDE (IntelliJ Plugin) v12.5.0.84934
- SonarQube is deployed with the IDE
- IntelliJ IDEA 2026.1.4 (MacOS)
I want my source code to pass with zero SonarQube based warnings/errors. When I have code that has the following Mockito expression (for example):
final var mock = Mockito.<Pageable<DTO>>mock();
I am prompted with SonarQube rule java:S8924: This rule raises an issue when Mockito core methods are called with the Mockito. prefix instead of being statically imported.
This is a false positive as using the Mockito. prefix is required when mocking parameterised types. It cannot be replaced with a static import in Java 25.