I have to make a test the idempotency of a method.
Let us say i have class Person with following method:
public String doSomething(String a){
//do some stuff
personDao.delete(a)
}
and I need to test when something goes wrong before the delete that the next time you call the method doSomething it will create the same result as you wanted when it should have run correctly the first time. This could happen for example when you run a script that calls that method but fails for example by stopping the script. When you run the script the following time it should have give the same result without the failure.
Can you do this in a unit test?
Thanks in advance