What is EasyMock.replay() used for?

Surez picture Surez · May 13, 2011 · Viewed 41k times · Source

I'm a newbie to unit testing and Junit. I know the basics of Junit. I just started learning about the EasyMock framework.

I couldn't understand the use of replay() method.

Could anyone please provide some info?

I understand the use of EasyMock.expect() and EasyMock.verify().

Answer

Henri picture Henri · May 14, 2011

The replay method is used to pass the mock from recording (where you record the method you expect to be called) to replaying state (where you actually test).