MockitoRules
SUGGESTION
Simplification
Suppression
Disable all rules by adding
-XepOpt:Refaster:NamePattern=^(?!MockitoRules\$).*
as compiler argument.
Table of contents
Never
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("Never")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!MockitoRules\$Never).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
VerificationMode testNever() {
- return times(0);
+ return never();
}
VerifyOnce
SUGGESTION
Simplification
Suppression
Suppress false positives by adding the suppression annotation
@SuppressWarnings("VerifyOnce")
to the enclosing element.Disable this rule by adding
-XepOpt:Refaster:NamePattern=^(?!MockitoRules\$VerifyOnce).*
as compiler argument.
Samples
Shows the difference in example code before and after the Refaster rule is applied.
Object testVerifyOnce() {
- return verify(mock(Object.class), times(1));
+ return verify(mock(Object.class));
}