@Test
public void onStatusChangedShouldShowProgressNotificationWhenGivenIncompleteOfflineRegionStatus() throws NoSuchFieldException, IllegalAccessException, InterruptedException, NoSuchMethodException, InvocationTargetException {

    latch = new CountDownLatch(1);
    OfflineRegionStatus incompleteOfflineRegionStatus = createOfflineRegion(OfflineRegion.STATE_ACTIVE, 200, 98923, 898, 230909, 300, true, false);
    setMapNameAndDownloadAction(mapName, MapboxOfflineDownloaderService.SERVICE_ACTION.DOWNLOAD_MAP);
    registerLocalBroadcastReceiverForDownloadServiceUpdates();
    insertValueInPrivateField(mapboxOfflineDownloaderService, "serviceHandler", new Handler(mapboxOfflineDownloaderService.getApplication().getMainLooper()));
    Method method = mapboxOfflineDownloaderService.getClass().getDeclaredMethod("startDownloadProgressUpdater");
    method.setAccessible(true);
    method.invoke(mapboxOfflineDownloaderService);
    mapboxOfflineDownloaderService.onStatusChanged(incompleteOfflineRegionStatus, null);
    latch.await();
    double percentage = 100.0 * 200l/300l;
    String contentTitle = "Offline Map Download Progress: " + mapName;
    String contentText = "Downloading: " + NumberFormatter.formatDecimal(percentage) + " %";
    Intent intent = (Intent) resultsToCheck.get(0);
    assertBroadcastResults(intent, MapboxOfflineDownloaderService.SERVICE_ACTION_RESULT.SUCCESSFUL, mapName, String.valueOf(percentage), MapboxOfflineDownloaderService.SERVICE_ACTION.DOWNLOAD_MAP );
    ShadowNotificationManager shadowNotificationManager = Shadows.shadowOf((NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE));
    Notification notification = shadowNotificationManager.getNotification(mapboxOfflineDownloaderService.PROGRESS_NOTIFICATION_ID);
    assertEquals(null, notification);
    Thread.sleep((Long) getValueInPrivateField(mapboxOfflineDownloaderService, "timeBetweenUpdates") * 2);
    ShadowLooper.runUiThreadTasks();
    notification = shadowNotificationManager.getNotification(mapboxOfflineDownloaderService.PROGRESS_NOTIFICATION_ID);
    ShadowNotification shadowNotification = Shadows.shadowOf(notification);
    assertEquals(contentTitle, shadowNotification.getContentTitle());
    assertEquals(contentText, shadowNotification.getContentText());
    method = mapboxOfflineDownloaderService.getClass().getDeclaredMethod("stopDownloadProgressUpdater");
    method.setAccessible(true);
    method.invoke(mapboxOfflineDownloaderService);
}