It looks like PowerMockRunner does not support @ClassRule.
it will any time be possible use ClassRules ?
look http://stackoverflow.com/questions/38772027/powermockrunner-does-not-apply-junit-classrules
Short answer, I think - no.
It's not a part of PowerMock to support rules, it's jUnit functionality. But PowerMock reloads a test class with custom class loader and looks like it is done after jUnit applies @ClassRule.
One ugly workaround is to use
@PowerMockRunnerDelegate(BlockJUnit4ClassRunner.class)
Most helpful comment
One ugly workaround is to use
@PowerMockRunnerDelegate(BlockJUnit4ClassRunner.class)