@Test public void shouldReportErrorToFabricWhenUpdatingSyncedPrograms() throws LMISException { LMISException lmisException = mock(LMISException.class); doThrow(lmisException).when(malariaProgramRepository).bulkUpdateAsSynced((List<MalariaProgram>) anyObject()); syncTask.sync(); verify(lmisException).reportToFabric(); }
@Override public void sync() throws LMISException { try { List<MalariaProgram> pendingForSync = malariaProgramRepository.getPendingForSync(); restApi.syncUpMalariaPrograms(pendingForSync); malariaProgramRepository.bulkUpdateAsSynced(pendingForSync); } catch (LMISException exception) { exception.reportToFabric(); } }
MalariaProgramSyncTask implements SyncronizableTask { @Override public void sync() throws LMISException { try { List<MalariaProgram> pendingForSync = malariaProgramRepository.getPendingForSync(); restApi.syncUpMalariaPrograms(pendingForSync); malariaProgramRepository.bulkUpdateAsSynced(pendingForSync); } catch (LMISException exception) { exception.reportToFabric(); } } }
MalariaProgramSyncTask implements SyncronizableTask { @Override public void sync() throws LMISException { try { List<MalariaProgram> pendingForSync = malariaProgramRepository.getPendingForSync(); restApi.syncUpMalariaPrograms(pendingForSync); malariaProgramRepository.bulkUpdateAsSynced(pendingForSync); } catch (LMISException exception) { exception.reportToFabric(); } } MalariaProgramSyncTask(); }
MalariaProgramSyncTask implements SyncronizableTask { @Override public void sync() throws LMISException { try { List<MalariaProgram> pendingForSync = malariaProgramRepository.getPendingForSync(); restApi.syncUpMalariaPrograms(pendingForSync); malariaProgramRepository.bulkUpdateAsSynced(pendingForSync); } catch (LMISException exception) { exception.reportToFabric(); } } MalariaProgramSyncTask(); @Override void sync(); }
MalariaProgramSyncTask implements SyncronizableTask { @Override public void sync() throws LMISException { try { List<MalariaProgram> pendingForSync = malariaProgramRepository.getPendingForSync(); restApi.syncUpMalariaPrograms(pendingForSync); malariaProgramRepository.bulkUpdateAsSynced(pendingForSync); } catch (LMISException exception) { exception.reportToFabric(); } } MalariaProgramSyncTask(); @Override void sync();  }