【发布时间】:2011-07-20 02:25:29
【问题描述】:
我很难找到设置类的静态字段的方法。基本上是这样的:
public class Foo{
// ...
private static B b = null;
}
其中 B 是另一个类。
除了setInternalStateFromContext(),还有什么方法可以在 PowerMock 中做到这一点?使用上下文类方法设置一个字段似乎有点矫枉过正。
谢谢。
【问题讨论】:
标签: junit static mocking powermock