Suppose i have the following method :
public void runLoop(SomeIterator it){
while(it.hasNext()){
//do something
}
}
Now i want to pass in a SomeIterator Mock object that would return Boolean.TRUE in order to go into the loop, but I also want it to return Boolean.FALSE at some point (say after 10 times for example), is there a way to make this happen with PowerMock/EasyMock?
Thanks in advance for your help.
Here’s an excerpt from the EasyMock documentation: