Is there anyway we can have a mocked method behaves differently depending on how many times this mocked method gets called?
eg.
if you have a method called
public boolean mockedmMethod() {
//logic here
}
you want it mocked this way:
when 1st time mockedMethod() gets called, return true.
2nd time, 3rd time the following times it gets called… , return false.
Actually, I found out that:
also does the trick.