@Test public void shouldSyncUpRapidTestsData() throws Exception { ProgramDataForm rapidTest1 = new ProgramDataFormBuilder().build(); rapidTest1.setSynced(false); rapidTest1.setStatus(ProgramDataForm.STATUS.AUTHORIZED); ProgramDataForm rapidTest2 = new ProgramDataFormBuilder().build(); rapidTest2.setSynced(true); rapidTest2.setStatus(ProgramDataForm.STATUS.AUTHORIZED); syncUpManager.programDataFormRepository = mockedProgramDataFormRepository; when(mockedProgramDataFormRepository.listByProgramCode(Constants.RAPID_TEST_CODE)).thenReturn(newArrayList(rapidTest1, rapidTest2)); syncUpManager.syncRapidTestForms(); verify(mockedLmisRestApi).syncUpProgramDataForm(rapidTest1); }
public void syncRapidTestForms() { List<ProgramDataForm> forms; try { Log.d(TAG, "===> Preparing RapidTestForms for Syncing"); forms = FluentIterable .from(programDataFormRepository.listByProgramCode(Constants.RAPID_TEST_CODE)) .filter(programDataForm -> !programDataForm.isSynced() && programDataForm.getStatus().equals(ProgramDataForm.STATUS.AUTHORIZED)) .toList(); Log.d(TAG, "===> SyncRapidTestForms :" + forms.size() + " ProgramDataForm ready to sync..."); if (forms.size() == 0) { return; } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncRapidTestForms").reportToFabric(); return; } Observable.from(forms) .filter(this::submitProgramDataForm) .subscribe(this::markProgramDataFormsSynced); }
SyncUpManager { public void syncRapidTestForms() { List<ProgramDataForm> forms; try { Log.d(TAG, "===> Preparing RapidTestForms for Syncing"); forms = FluentIterable .from(programDataFormRepository.listByProgramCode(Constants.RAPID_TEST_CODE)) .filter(programDataForm -> !programDataForm.isSynced() && programDataForm.getStatus().equals(ProgramDataForm.STATUS.AUTHORIZED)) .toList(); Log.d(TAG, "===> SyncRapidTestForms :" + forms.size() + " ProgramDataForm ready to sync..."); if (forms.size() == 0) { return; } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncRapidTestForms").reportToFabric(); return; } Observable.from(forms) .filter(this::submitProgramDataForm) .subscribe(this::markProgramDataFormsSynced); } }
SyncUpManager { public void syncRapidTestForms() { List<ProgramDataForm> forms; try { Log.d(TAG, "===> Preparing RapidTestForms for Syncing"); forms = FluentIterable .from(programDataFormRepository.listByProgramCode(Constants.RAPID_TEST_CODE)) .filter(programDataForm -> !programDataForm.isSynced() && programDataForm.getStatus().equals(ProgramDataForm.STATUS.AUTHORIZED)) .toList(); Log.d(TAG, "===> SyncRapidTestForms :" + forms.size() + " ProgramDataForm ready to sync..."); if (forms.size() == 0) { return; } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncRapidTestForms").reportToFabric(); return; } Observable.from(forms) .filter(this::submitProgramDataForm) .subscribe(this::markProgramDataFormsSynced); } SyncUpManager(); }
SyncUpManager { public void syncRapidTestForms() { List<ProgramDataForm> forms; try { Log.d(TAG, "===> Preparing RapidTestForms for Syncing"); forms = FluentIterable .from(programDataFormRepository.listByProgramCode(Constants.RAPID_TEST_CODE)) .filter(programDataForm -> !programDataForm.isSynced() && programDataForm.getStatus().equals(ProgramDataForm.STATUS.AUTHORIZED)) .toList(); Log.d(TAG, "===> SyncRapidTestForms :" + forms.size() + " ProgramDataForm ready to sync..."); if (forms.size() == 0) { return; } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncRapidTestForms").reportToFabric(); return; } Observable.from(forms) .filter(this::submitProgramDataForm) .subscribe(this::markProgramDataFormsSynced); } SyncUpManager(); boolean syncRnr(); boolean fakeSyncRnr(); boolean syncStockCards(); boolean fakeSyncStockCards(); void syncUpUnSyncedStockCardCodes(); void fakeSyncUpUnSyncedStockCardCodes(); void syncAppVersion(); void syncArchivedProducts(); void syncUpCmms(); void fakeSyncUpCmms(); boolean syncDeleteMovement(); void syncRapidTestForms(); void fakeSyncRapidTestForms(); }
SyncUpManager { public void syncRapidTestForms() { List<ProgramDataForm> forms; try { Log.d(TAG, "===> Preparing RapidTestForms for Syncing"); forms = FluentIterable .from(programDataFormRepository.listByProgramCode(Constants.RAPID_TEST_CODE)) .filter(programDataForm -> !programDataForm.isSynced() && programDataForm.getStatus().equals(ProgramDataForm.STATUS.AUTHORIZED)) .toList(); Log.d(TAG, "===> SyncRapidTestForms :" + forms.size() + " ProgramDataForm ready to sync..."); if (forms.size() == 0) { return; } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncRapidTestForms").reportToFabric(); return; } Observable.from(forms) .filter(this::submitProgramDataForm) .subscribe(this::markProgramDataFormsSynced); } SyncUpManager(); boolean syncRnr(); boolean fakeSyncRnr(); boolean syncStockCards(); boolean fakeSyncStockCards(); void syncUpUnSyncedStockCardCodes(); void fakeSyncUpUnSyncedStockCardCodes(); void syncAppVersion(); void syncArchivedProducts(); void syncUpCmms(); void fakeSyncUpCmms(); boolean syncDeleteMovement(); void syncRapidTestForms(); void fakeSyncRapidTestForms();  }