so I have a function that deletes some object, thing. This can take a while, like a half hour ish, and I want to check if it is successfully deleted.
@Test
public void successfulThingDelete(){
Thing thing = new Thing();
deleteThing(thing);
if (thing.getStatus() == 'deleted'){
pass
}
else {
fail
}
I want to be able to continually check the status of thing (i.e thing.getStatus()) and pass the test if it is deleted. But if a certain time elapses and it's not deleted then the code has failed and it should fail. I'm assuming I need to introduce a new thread for this pinging of the status but I'm not sure how to add that within this method. Thanks for any help!