@Test public void doInBackground() { when(mContext.getSystemService(DOWNLOAD_SERVICE)).thenReturn(mDownloadManager); DownloadManagerRemoveTask task = new DownloadManagerRemoveTask(mContext, DOWNLOAD_ID); task.doInBackground(); verify(mDownloadManager).remove(DOWNLOAD_ID); }
@SuppressWarnings("ConstantConditions") @Override protected Void doInBackground(Void... params) { DownloadManager downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); downloadManager.remove(mDownloadId); return null; }
DownloadManagerRemoveTask extends AsyncTask<Void, Void, Void> { @SuppressWarnings("ConstantConditions") @Override protected Void doInBackground(Void... params) { DownloadManager downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); downloadManager.remove(mDownloadId); return null; } }
DownloadManagerRemoveTask extends AsyncTask<Void, Void, Void> { @SuppressWarnings("ConstantConditions") @Override protected Void doInBackground(Void... params) { DownloadManager downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); downloadManager.remove(mDownloadId); return null; } DownloadManagerRemoveTask(Context context, long downloadId); }
DownloadManagerRemoveTask extends AsyncTask<Void, Void, Void> { @SuppressWarnings("ConstantConditions") @Override protected Void doInBackground(Void... params) { DownloadManager downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); downloadManager.remove(mDownloadId); return null; } DownloadManagerRemoveTask(Context context, long downloadId);  }
DownloadManagerRemoveTask extends AsyncTask<Void, Void, Void> { @SuppressWarnings("ConstantConditions") @Override protected Void doInBackground(Void... params) { DownloadManager downloadManager = (DownloadManager) mContext.getSystemService(Context.DOWNLOAD_SERVICE); downloadManager.remove(mDownloadId); return null; } DownloadManagerRemoveTask(Context context, long downloadId);   }