Running the following unit test throws the exception: java.lang.IllegalStateException: no last call on a mock available
import org.easymock.*;
import org.junit.*;
public class MyTest {
@Test
public void testWithClass() {
Thread threadMock = EasyMock.createMock(Thread.class);
EasyMock.expect(threadMock.isAlive()).andReturn(true);
}
}
I am not sure what I am doing wrong and can not find any good examples on the web. How do you mock a class using EasyMock 3.0. What is wrong with the above unit test? Any help would be greatly appreciated.
My project includes the following maven dependencies
org.easymock
easymock
3.0
test
cglib
cglib-nodep
2.2
test
org.objenesis
objenesis
1.2
test