PowerMock and Mockito


mockito

https://site.mockito.org/

Tasty mocking framework for unit tests in Java

PowerMock

PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

https://github.com/powermock/powermock

PowerMock基于Mockito开发,起语法规则与Mockito一致,主要区别在于使用方面,以实现完成对private/static/final等方法(也支持mock的对象是在方法内部new出来的)的Mock(模拟).

资料: https://www.jianshu.com/p/69f3d6785ad8

https://www.cnblogs.com/bodhitree/p/9456515.html

https://www.ibm.com/developerworks/cn/java/j-lo-powermock/

微信扫描二维码,关注后回复,获取精华资料!

1、回复「书单」:免费获取百本「豆瓣」高分好书。
2、回复「赚钱」:领取实用的36个赚钱小项目。
3、回复「TED」:送你100场TED最受欢迎的演讲,感受最顶尖的思想。
4、回复「学习」:免费获赠英语7000单词速记法(价值200元,很好用),四六级轻松过;
5、回复「PPT」:送你500套好看又实用的PPT模板,让你的PPT颜值爆表]
6、回复「88」:java精品案例,微服务架构Springboot项目实战

评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×