use of com.liulishuo.filedownloader.database.FileDownloadDatabase in project FileDownloader by lingochamp.
the class DownloadLaunchRunnableTest method getMockNonOptDatabaseMaker.
private static FileDownloadHelper.DatabaseCustomMaker getMockNonOptDatabaseMaker() {
final FileDownloadDatabase database = mock(FileDownloadDatabase.class);
when(database.maintainer()).thenReturn(new FileDownloadDatabase.Maintainer() {
@Override
public void onFinishMaintain() {
}
@Override
public void onRemovedInvalidData(FileDownloadModel model) {
}
@Override
public void onRefreshedValidData(FileDownloadModel model) {
}
@Override
public void changeFileDownloadModelId(int oldId, FileDownloadModel modelWithNewId) {
}
@Override
public Iterator<FileDownloadModel> iterator() {
return new Iterator<FileDownloadModel>() {
@Override
public boolean hasNext() {
return false;
}
@Override
public FileDownloadModel next() {
return null;
}
};
}
});
return new FileDownloadHelper.DatabaseCustomMaker() {
@Override
public FileDownloadDatabase customMake() {
return database;
}
};
}
Aggregations