-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add validation check for the return value of methods annotated with @Rule #1016
Comments
Also, methods annotated with |
@kcooney All validations are already in place.
|
@NarendraPathai you can only use BTW, |
@kcooney // should fail validation if @ClassRule does not allow `MethodRule`
public class ClassRuleTest {
@ClassRule
public static MethodRule methodRule() {
return new MethodRule() {
@Override
public Statement apply(Statement base, FrameworkMethod method, Object target) {
return base;
}
};
}
@Test
public void doNothing() {
}
} |
@NarendraPathai we should certainly update the validation code for this. Class rules work on the class, so there is no method to pass to a
If you don't want to work on this, let's open a new bug so we can track it. Thanks! |
We should add a validation check that methods annotated with
@Rule
are public and return either aTestRule
(or subclass) or aMethodRule
(or subclass)The text was updated successfully, but these errors were encountered: