I just solved this one now, when I added the @RunWith(PowerMockRunner.class)
attribute, eclipse
automatically imported:
import org.powermock.modules.junit4.legacy.PowerMockRunner;
All I needed to do is change it to be:
import org.powermock.modules.junit4.PowerMockRunner;
And now it works fine with JUnit 4.8.2
.
The 2nd runner is for when running with older versions of JUnit
- specifically 4.3
and older.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…