@Test public void performErrorCleansUpAndDoesNotAddToBatchIfCancelled() { BitmapHunter hunter = mockHunter(URI_KEY_1, bitmap1, false); when(hunter.isCancelled()).thenReturn(true); dispatcher.hunterMap.put(hunter.getKey(), hunter); dispatcher.performError(hunter, false); assertThat(dispatcher.hunterMap).isEmpty(); assertThat(dispatcher.batch).isEmpty(); }
void performError(BitmapHunter hunter, boolean willReplay) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_BATCHED, getLogIdsForHunter(hunter), "for error" + (willReplay ? " (will replay)" : "")); } hunterMap.remove(hunter.getKey()); batch(hunter); }
Dispatcher { void performError(BitmapHunter hunter, boolean willReplay) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_BATCHED, getLogIdsForHunter(hunter), "for error" + (willReplay ? " (will replay)" : "")); } hunterMap.remove(hunter.getKey()); batch(hunter); } }
Dispatcher { void performError(BitmapHunter hunter, boolean willReplay) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_BATCHED, getLogIdsForHunter(hunter), "for error" + (willReplay ? " (will replay)" : "")); } hunterMap.remove(hunter.getKey()); batch(hunter); } Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats); }
Dispatcher { void performError(BitmapHunter hunter, boolean willReplay) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_BATCHED, getLogIdsForHunter(hunter), "for error" + (willReplay ? " (will replay)" : "")); } hunterMap.remove(hunter.getKey()); batch(hunter); } Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats);  }
Dispatcher { void performError(BitmapHunter hunter, boolean willReplay) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_BATCHED, getLogIdsForHunter(hunter), "for error" + (willReplay ? " (will replay)" : "")); } hunterMap.remove(hunter.getKey()); batch(hunter); } Dispatcher(Context context, ExecutorService service, Handler mainThreadHandler,
      Downloader downloader, Cache cache, Stats stats);   }