KentBeck/junit — Issue #351: missing current instance in TestRule apply()
Author: RainerW
Created: 2011-10-24 09:45:33+00:00
State: open

I switched form 4.8 to 4.10 and decided to change my MethodRule's to TestRule ... bad idea.

I'm missing a way to get the FrameworkMethod, and the current test instance, they are missing now in the apply method:

old:
public Statement apply(final Statement base, final FrameworkMethod method, Object target)

new:
public Statement apply(final Statement base, final Description description)

How can i get them? I debugged and the actual Statement instance is of type InvokeMethod, this would have what i need, but dosn't have getter for the private fields.

At the moment i can just keep using MethodRule, but i'm afraid this will not work in further versions anymore.