Skip to content

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

@yschimke

Description

@yschimke

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

Metadata

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