@Test public void shouldReportToFabricWhenRestError() throws Exception { LMISException lmisException = mock(LMISException.class); LMISException lmisException1 = new LMISException("aaa"); lmisException.setLMISExcetption(lmisException1); doThrow(lmisException).when(restApi).syncUpMalariaPrograms(pendingForSync); 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();  }