@Test
public void get_createAndInsert_onSyncToFilesystemSuccess_update() throws IOException {
final int id1 = store.findOrCreateId(mockTask());
final int id2 = store.findOrCreateId(mockTask());
assertThat(id1).isNotEqualTo(id2);
verify(onCache, times(2)).findOrCreateId(any(DownloadTask.class));
final DownloadTask task = mock(DownloadTask.class);
when(task.getId()).thenReturn(id2);
when(task.getUrl()).thenReturn("url");
when(task.getParentFile()).thenReturn(new File("p-path"));
doReturn("filename").when(task).getFilename();
store.createAndInsert(task);
final BreakpointInfo info2 = onCache.get(id2);
assertThat(info2).isNotNull();
verify(helper).insert(info2);
info2.addBlock(new BlockInfo(0, 20, 5));
store.onSyncToFilesystemSuccess(info2, 0, 10);
verify(onCache).onSyncToFilesystemSuccess(info2, 0, 10);
verify(helper).updateBlockIncrease(info2, 0, 15);
info2.setEtag("new-etag");
store.update(info2);
verify(onCache).update(info2);
verify(helper).updateInfo(info2);
}