2021
10-17
10-17
怎样使用PowerMockito 测试静态方法
PowerMockito测试静态方法假如有下面一个类DemoStatic,它里面定义了各种静态方法,这些静态方法可能是一些Utilities方法,辅助其它的类。packagemock.demo;publicclassDemoStatic{publicstaticStringsayHello(){return"Hello";}publicstaticStringsaySomething(Stringword){returnword;}publicstaticvoidsayAgain(){System.out.println(getMyWord());}privatestaticStringgetMyWord(){...
继续阅读 >