@Test public void shouldNotInvokeNetworkWhenNoUnsyncedCmmPresent() throws Exception { List<Cmm> emptyCmmsList = new ArrayList<>(); when(mockedCmmRepository.listUnsynced()).thenReturn(emptyCmmsList); syncUpManager.syncUpCmms(); verify(mockedLmisRestApi, never()).syncUpCmms(anyString(), anyList()); }
public void syncUpCmms() { try { List<Cmm> unsyncedCmms = cmmRepository.listUnsynced(); if (!unsyncedCmms.isEmpty()) { List<CmmEntry> cmmEntries = FluentIterable .from(unsyncedCmms) .transform(CmmEntry::createFrom) .toList(); lmisRestApi.syncUpCmms(UserInfoMgr.getInstance().getUser().getFacilityId(), cmmEntries); for (Cmm cmm : unsyncedCmms) { cmm.setSynced(true); cmmRepository.save(cmm); } } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncUpCmms").reportToFabric(); } }
SyncUpManager { public void syncUpCmms() { try { List<Cmm> unsyncedCmms = cmmRepository.listUnsynced(); if (!unsyncedCmms.isEmpty()) { List<CmmEntry> cmmEntries = FluentIterable .from(unsyncedCmms) .transform(CmmEntry::createFrom) .toList(); lmisRestApi.syncUpCmms(UserInfoMgr.getInstance().getUser().getFacilityId(), cmmEntries); for (Cmm cmm : unsyncedCmms) { cmm.setSynced(true); cmmRepository.save(cmm); } } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncUpCmms").reportToFabric(); } } }
SyncUpManager { public void syncUpCmms() { try { List<Cmm> unsyncedCmms = cmmRepository.listUnsynced(); if (!unsyncedCmms.isEmpty()) { List<CmmEntry> cmmEntries = FluentIterable .from(unsyncedCmms) .transform(CmmEntry::createFrom) .toList(); lmisRestApi.syncUpCmms(UserInfoMgr.getInstance().getUser().getFacilityId(), cmmEntries); for (Cmm cmm : unsyncedCmms) { cmm.setSynced(true); cmmRepository.save(cmm); } } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncUpCmms").reportToFabric(); } } SyncUpManager(); }
SyncUpManager { public void syncUpCmms() { try { List<Cmm> unsyncedCmms = cmmRepository.listUnsynced(); if (!unsyncedCmms.isEmpty()) { List<CmmEntry> cmmEntries = FluentIterable .from(unsyncedCmms) .transform(CmmEntry::createFrom) .toList(); lmisRestApi.syncUpCmms(UserInfoMgr.getInstance().getUser().getFacilityId(), cmmEntries); for (Cmm cmm : unsyncedCmms) { cmm.setSynced(true); cmmRepository.save(cmm); } } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncUpCmms").reportToFabric(); } } 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 syncUpCmms() { try { List<Cmm> unsyncedCmms = cmmRepository.listUnsynced(); if (!unsyncedCmms.isEmpty()) { List<CmmEntry> cmmEntries = FluentIterable .from(unsyncedCmms) .transform(CmmEntry::createFrom) .toList(); lmisRestApi.syncUpCmms(UserInfoMgr.getInstance().getUser().getFacilityId(), cmmEntries); for (Cmm cmm : unsyncedCmms) { cmm.setSynced(true); cmmRepository.save(cmm); } } } catch (LMISException e) { new LMISException(e, "SyncUpManager.syncUpCmms").reportToFabric(); } } 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();  }