I am trying to run just a simple test using easyMock:
public class Class1 implements Interface1{
public void method1(Object obj){
if(isEnable()){
doSmth();
}
}
public boolean isEnable(){
return isEnable;
}
}
My test:
Interface1 test1= Interface1(Class1.class);
test1.method1(anyObject);
expectLastCall();
expect(test1.isEnable).andReturn(true);
replay(test1);
test1.method1(new Object());
verify(test1);
Error:
Expectation failure on verify: isEnable(): expected: 1, actual: 0
Where is the problem? I have read tons of examples where there are similar problems with the parameters sent, but not a method without params example1 or this tutorial, that I found interesting
Thanks in advance