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/

评论

Your browser is out-of-date!

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

×