Is it possible to set different expectations for a mock which is being invoked in a loop?
Considering the use case,
while(condition){
List list = Database call //Call to be mocked
....
Logic based on above response
}
how can we set expectations such the first iteration returns a list of objects, while the second call returns empty list?