}
@Test
public void should_return_empty_source_if_preview_mode_and_no_last_snapshot() throws URISyntaxException {
db.prepareDbUnit(getClass(), "last_snapshot.xml");
ServerClient server = mock(ServerClient.class);
when(server.request(anyString(), eq("GET"), eq(false), eq(30 * 1000))).thenThrow(new HttpDownloader.HttpException(new URI(""), 404));
when(mode.isPreview()).thenReturn(true);
LastSnapshots lastSnapshots = new LastSnapshots(mode, new SnapshotSourceDao(db.myBatis()), server);
String source = lastSnapshots.getSource(newFileWithSpace());