运行单元测试时遇到此错误。我使用intellij和EasyMock 3.0和cglib(2.2)和Objenesis(1.2)。VerifyError:class net.sf.cglib.core.DebuggingClassWriter重写最终方法访问
这里是我的测试:
public void testGetContentOk() throws Exception {
EasyMock.expect(mockConnectionFactory.getData()).andReturn(mockInputStream);
EasyMock.expect(mockInputStream.read()).andReturn(new Integer((byte)'I'));
EasyMock.expect(mockInputStream.read()).andReturn(-1);
mockInputStream.close();
EasyMock.replay(mockConnectionFactory);
EasyMock.replay(mockInputStream);
WebClient webClient = new WebClient();
String result = webClient.getContent(mockConnectionFactory);
Assert.assertEquals("I", result);
}
有谁知道为什么会这样?
我很好奇这件事,因为我已经使用正确的版本,至少我认为是这样。我会很感激任何帮助。