}
@Test
public void getStatusAndDeleteIfFinishedTest() {
//nothing to delete..
when(jobCurator.find("bogus_id")).thenReturn(new JobStatus());
jobResource.getStatusAndDeleteIfFinished("foobar");
verify(jobCurator, never()).delete(any(JobStatus.class));
//now lets make a deletable JobStatus
JobStatus finishedJobStatus = new JobStatus();
finishedJobStatus.setState(JobState.FINISHED);
when(jobCurator.find("deletable_id")).thenReturn(finishedJobStatus);
jobResource.getStatusAndDeleteIfFinished("deletable_id");
verify(jobCurator, atLeastOnce()).delete(finishedJobStatus);
}