关于powermock报错org.powermock.reflect.exceptions.FieldNotFoundException: Field 'fTestClass' was not found in class org.junit.internal.runners.MethodValidator.问题解决

事件背景

使用PowerMock模拟一个局部变量,添加@RunWith(PowerMockRunner.class)、@PrepareForTest(StudentService.class)注解成功

运行报错如下图:

 解决方案:

经过度娘发现,是jar包的原因升级就好了

原文地址:https://www.cnblogs.com/longronglang/p/11901070.html