You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JUnit ClassRule should be treated the same way as JUnit Rule, as must should be declared public.
Currently only @rule is ignored from the check and latest version complains about:
Variable 'myClassRule' must be private and have accessor methods. [VisibilityModifier]
Class:
/tmp/checkstyle :: cat Example.java
public class Class {
@org.junit.Rule
public Rule rule = new Rule();
@org.junit.ClassRule
public static Rule classRule = new ClassRule();
}
The JUnit ClassRule should be treated the same way as JUnit Rule, as must should be declared public.
Currently only @rule is ignored from the check and latest version complains about:
Variable 'myClassRule' must be private and have accessor methods. [VisibilityModifier]
Class:
XML:
Outcome:
JUnit rule is in the 'whitelist' in VisibilityModifierCheck class:
but the ClassRule is not, even if it's the same principle.
The text was updated successfully, but these errors were encountered: