I have a client class that looks like the following:
class MyClient{
Service service;
public MyClient(Service service){ ... }
public boolean CoreFunction(Object arg1, Object arg2){
Service.AnotherClass instance = new Service.AnotherClass(arg1, arg2);
service.call(instance);
if(instance.isSuccessful()) { ...; return true; }
else { ...; return false; }
}
}
The instance's isSuccessful() returns a flag that will be upaded by the service.call() internally. I want to test the logic if instance.isSuccessful() is true and false. How can I use EasyMock to achieve this? Thank you.