Open
Description
openedon Aug 2, 2010
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment