Hi,
PowerMockJUnit47RunnerDelegateImpl throws a ClassCastException at line 79 :
MethodRule rule = (MethodRule) field.get(testInstance);
Rules in junit 4.10 implement TestRule, not MethodRule.
Here is a simple testcase:
@RunWith(PowerMockRunner.class)
public class PowerMockBug {
@Rule
public MyRule rule = new MyRule();
@Test
public void testFoo() {
System.out.println("testing foo");
}
public static class MyRule implements TestRule {
@Override
public Statement apply(Statement base, Description description) {
return base;
}
}
}
Original issue reported on code.google.com by karl.via...@gmail.com on 3 May 2012 at 3:09
Original issue reported on code.google.com by
karl.via...@gmail.com
on 3 May 2012 at 3:09