我试图在我的eclipse项目中使用mockito。由于某种原因,每次我要运行单元测试时都会遇到这个错误:
java.lang.NoClassDefFoundError: org/mockito/Mockito引起的: java.lang.ClassNotFoundException: org.mockito.Mockito
我的代码与mockito示例中的代码类似:
@Test
public void testExecuteStep(){
List test = mock(List.class); //here the exception will be thrown.
}有人能给我一个解决这个问题的办法吗?
发布于 2012-08-22 12:32:52
在我看来,Mockito在您的项目中没有正确的设置,您确定它在类路径上吗?
https://stackoverflow.com/questions/12073022
复制相似问题