AssignThumbnailAsyncTask extends AsyncTask<String, Void, Bitmap> { @Override protected Bitmap doInBackground(String... params) { imageName = params[0]; return photoCaptureHelper.getThumbnailOrDefault(imageName); } AssignThumbnailAsyncTask(ImageView imageView, PhotoCaptureHelper photoCaptureHelper); String getImageName();  }
@Test public void shouldUseCaptureHelperToLoadImage(){ AssignThumbnailAsyncTask task = new AssignThumbnailAsyncTask(imageView, photoCaptureHelper); String filename = "someFilename"; task.doInBackground(filename); verify(photoCaptureHelper).getThumbnailOrDefault(filename); }