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
MethodRule only gets invoked for the test method, however for a change where you would otherwise extend BlockJUnit4ClassRunner and override withBefores, you can't achieve the same with a Rule.
MethodRule should have a sub-interface e.g. LifeCycleAwareRule that allows a rule to change the test instance before the @before block is run.
One example is unitils @SpringBeanByType, these must be injected before the @before block runs, but with Rule this is not possible