@Test public void shouldCallEmergencyRequisition() throws Exception { RnRForm form = new RnRForm(); form.setEmergency(true); when(mockedRnrFormRepository.queryAllUnsyncedForms()).thenReturn(newArrayList(form)); syncUpManager.syncRnr(); verify(mockedLmisRestApi).submitEmergencyRequisition(any(RnRForm.class)); }
public boolean syncRnr() { List<RnRForm> forms; try { Log.d(TAG, "===> Preparing RnrForm for Syncing: Delete Deactivated Products..."); forms = rnrFormRepository.queryAllUnsyncedForms(); Log.d(TAG, "===> SyncRnR :" + forms.size() + " RnrForm ready to sync..."); if (forms.size() == 0) { return false; } } catch (LMISException e) { new LMISException(e, "SyncUpManager:syncRnr").reportToFabric(); return false; } Observable.from(forms).filter(this::submitRequisition).subscribe(this::markRnrFormSynced); return from(forms).allMatch(RnRForm::isSynced); }
SyncUpManager { public boolean syncRnr() { List<RnRForm> forms; try { Log.d(TAG, "===> Preparing RnrForm for Syncing: Delete Deactivated Products..."); forms = rnrFormRepository.queryAllUnsyncedForms(); Log.d(TAG, "===> SyncRnR :" + forms.size() + " RnrForm ready to sync..."); if (forms.size() == 0) { return false; } } catch (LMISException e) { new LMISException(e, "SyncUpManager:syncRnr").reportToFabric(); return false; } Observable.from(forms).filter(this::submitRequisition).subscribe(this::markRnrFormSynced); return from(forms).allMatch(RnRForm::isSynced); } }
SyncUpManager { public boolean syncRnr() { List<RnRForm> forms; try { Log.d(TAG, "===> Preparing RnrForm for Syncing: Delete Deactivated Products..."); forms = rnrFormRepository.queryAllUnsyncedForms(); Log.d(TAG, "===> SyncRnR :" + forms.size() + " RnrForm ready to sync..."); if (forms.size() == 0) { return false; } } catch (LMISException e) { new LMISException(e, "SyncUpManager:syncRnr").reportToFabric(); return false; } Observable.from(forms).filter(this::submitRequisition).subscribe(this::markRnrFormSynced); return from(forms).allMatch(RnRForm::isSynced); } SyncUpManager(); }
SyncUpManager { public boolean syncRnr() { List<RnRForm> forms; try { Log.d(TAG, "===> Preparing RnrForm for Syncing: Delete Deactivated Products..."); forms = rnrFormRepository.queryAllUnsyncedForms(); Log.d(TAG, "===> SyncRnR :" + forms.size() + " RnrForm ready to sync..."); if (forms.size() == 0) { return false; } } catch (LMISException e) { new LMISException(e, "SyncUpManager:syncRnr").reportToFabric(); return false; } Observable.from(forms).filter(this::submitRequisition).subscribe(this::markRnrFormSynced); return from(forms).allMatch(RnRForm::isSynced); } 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 boolean syncRnr() { List<RnRForm> forms; try { Log.d(TAG, "===> Preparing RnrForm for Syncing: Delete Deactivated Products..."); forms = rnrFormRepository.queryAllUnsyncedForms(); Log.d(TAG, "===> SyncRnR :" + forms.size() + " RnrForm ready to sync..."); if (forms.size() == 0) { return false; } } catch (LMISException e) { new LMISException(e, "SyncUpManager:syncRnr").reportToFabric(); return false; } Observable.from(forms).filter(this::submitRequisition).subscribe(this::markRnrFormSynced); return from(forms).allMatch(RnRForm::isSynced); } 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();  }