EasyMock is a mocking framework for Java. Here we look at EasyMock 2.2 which requires Java 5 and has the folowing following benefits:
- Hand-writing classes for Mock Objects is not needed.
- Supports refactoring-safe Mock Objects: test code will not break at runtime when renaming methods or reordering method parameters
- Supports return values and exceptions.
- Supports checking the order of method calls, for one or more Mock Objects.