Top "Easymock" questions

Easymock is a mocking framework for Java.

Getting EasyMock mock objects to throw Exceptions

I'm in process of using EasyMock to write Unit tests for a number of collaborating classes. One of these classes (…

java unit-testing easymock
What is EasyMock.replay() used for?

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

testing junit easymock
NoClassDefFoundError when using Powermock

I'm running a junit test case using the PowerMock test runner. I'm using the following command line to execute it: …

java unit-testing junit easymock powermock
How to test void methods using EasyMock

I've seen a few questions out there regarding this but I can't seem to make sense of any of the …

java unit-testing junit easymock
How can I mock a method in easymock that shall return one of its parameters?

public Object doSomething(Object o); which I want to mock. It should just return its parameter. I tried: Capture<…

java mocking capture easymock
EasyMock : java.lang.IllegalStateException: 1 matchers expected, 2 recorded

I am having a problem with EasyMock 2.5.2 and JUnit 4.8.2 (running through Eclipse). I have read all the similar posts here …

java easymock matcher
Expecting anything as parameter to mock using EasyMock

Using EasyMock I want to be able to say that I expect a specific method called on my mock, but …

java unit-testing tdd mocking easymock
Testing private method using power mock which return list of Integers

I have a private method which take a list of integer value returns me a list of integer value. How …

java easymock powermock
EasyMock andReturn() vs andStubReturn()

What is the difference between using andReturn(T value) vs andStubReturn(T value) for EasyMock? In what situation would you …

unit-testing easymock
JUnit Easymock Unexpected method call

I'm trying to setup a test in JUnit w/ EasyMock and I'm running into a small issue that I can't …

junit methods call easymock