建议类型:可模拟的静态调用
是否可在首选项配置:是
过滤器分类:模拟
当根据配置模拟选项中指定的配置检测到对可模拟的静态方法或构造函数的调用时,UTA 将显示此建议。
public static class StaticExample { private static boolean value = false; public static void setValue(boolean newValue) { value = newValue; } } public class Example { public void setValue(boolean newValue) { StaticExample.setValue(newValue); } } @Test public void testSetValue() { boolean newValue = true; Example underTest = new Example(); underTest.setValue(newValue); } |