Archives for May 3rd, 2008
A pattern for using EasyMock…
Saturday, May 3rd, 2008
Ralf Stuckert wrote a great article on EasyMock titled "Getting started with EasyMock2." He clearly defined a pattern for using this library.
The pattern is
Create a mock.
Set up your expectations.
Set the mock to replay mode.
Call your code under test.
Verify that your expectations have been met.
Believe me, knowing this pattern will save you a lot [...]