What's the best mock framework for Java? [clos

2019-01-01 06:22发布

What's the best framework for creating mock objects in Java? Why? What are the pros and cons of each framework?

14条回答
只靠听说
2楼-- · 2019-01-01 06:45

The JMockit project site contains plenty of comparative information for current mocking toolkits.

In particular, check out the feature comparison matrix, which covers EasyMock, jMock, Mockito, Unitils Mock, PowerMock, and of course JMockit. I try to keep it accurate and up-to-date, as much as possible.

查看更多
萌妹纸的霸气范
3楼-- · 2019-01-01 06:48

I started using mocks through JMock, but eventually transitioned to use EasyMock. EasyMock was just that, --easier-- and provided a syntax that felt more natural. I haven't switched since.

查看更多
登录 后发表回答