I am experiencing unexpected behavior of EasyMock when writing junit test. Finally, I deleted some lines of code until there is one line of creating mock left to see what happened.
@Test
public void testSimple() throws Exception {
Socket socket = EasyMock.createMock(Socket.class);
}
This junit test generates error:
[junit] Tests run: 1, Failures: 0, Errors: 1, Time elapsed: 0.052 sec
This is not the case when I just have normal instantiation like:
@Test
public void testSimple() throws Exception {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
}
This junit test seems happy with that:
[junit] Tests run: 1, Failures: 0, Errors: 0, Time elapsed: 0.047 sec
I wonder if someone can clear this ambiguity. Thanks.