@Test
public void shouldFindByPreviousVersionWhenPreviousVersionDeleted() {
setupData("with-previous-version-deleted");
PastSnapshotFinderByPreviousVersion finder = new PastSnapshotFinderByPreviousVersion(getSession());
Snapshot currentProjectSnapshot = getSession().getSingleResult(Snapshot.class, "id", 1003);
PastSnapshot foundSnapshot = finder.findByPreviousVersion(currentProjectSnapshot);
assertThat(foundSnapshot.getProjectSnapshotId()).isEqualTo(1000);
assertThat(foundSnapshot.getMode()).isEqualTo(CoreProperties.TIMEMACHINE_MODE_PREVIOUS_VERSION);
assertThat(foundSnapshot.getModeParameter()).isEqualTo("1.0");
}