package demo.powermock; public class XxxService { /* * 1.修改私有域 * - unit test 必须保证 '快',需要修改private field */ private static int threshold = 1000000; public int sum() { int i=0; while(i < threshold) { i=i+1; } return i; } /* * 2.测试私有方法 */ private boolean isPositiveNumber(int i) { if(i > 0) { return true; } else { return false; } } /* * 3.无返回值,校验:对某方法调用次数 */ public void foreach(int count) { for(int i=0; i