PowerMock, mockito, verify static method
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to get PowerMock to work with mockito, and I'm following the documentation here: http://code.google.com/p/powermock/wiki/MockitoUsage13 . To simplify a bit, lets say that I have a static method: StaticObj . put ( String key , String val ) { ... } And the class to be tested does something like this: public class ClassToTest { public void doSomething ( Params p ) { if ( StringUtils . isNotBlank ( p . getK ()) StaticObj . put ( "k1" , p . getK ()); if ( StringUtils . isNotBlank ( p . getX ()) StaticObj . put ( "x1" , p .