Skip to content

Add an extension point to replace the test instance. #129

Open

Description

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

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions