SharedPreferenceMgr { public boolean isRequisitionDataSynced() { RnrFormRepository rnrFormRepository = RoboGuice.getInjector(LMISApp.getContext()).getInstance(RnrFormRepository.class); return sharedPreferences.getBoolean(SharedPreferenceMgr.KEY_IS_REQUISITION_DATA_SYNCED, rnrFormRepository.hasRequisitionData()); } @Inject  SharedPreferenceMgr(Context context); static SharedPreferenceMgr getInstance(); SharedPreferences getPreference(); boolean hasSyncedVersion(); void setSyncedVersion(boolean hasUpdated); boolean isLastMonthStockDataSynced(); void setLastMonthStockCardDataSynced(boolean isStockCardSynced); boolean shouldSyncLastYearStockData(); void setShouldSyncLastYearStockCardData(boolean shouldSyncLastYearStockCardData); boolean isSyncingLastYearStockCards(); void setIsSyncingLastYearStockCards(boolean isSyncingLastYearStockCards); boolean isRequisitionDataSynced(); boolean hasDeletedOldStockMovement(); boolean hasDeletedOldRnr(); void setRequisitionDataSynced(boolean requisitionDataSynced); void setReportTypesData(List<ReportTypeForm> reportTypeFormList); List<ReportTypeForm> getReportTypesData(); boolean isNeedsInventory(); String getLastLoginUser(); void setLastLoginUser(String lastLoginUser); String getCurrentUserFacility(); void setCurrentUserFacility(String userFacility); void setIsNeedsInventory(boolean isNeedsInventory); String getLastSyncServiceTime(); void setKeyLastSyncServiceTime(String lastSyncProductTime); String getLastSyncProductTime(); void setLastSyncProductTime(String lastSyncProductTime); boolean isNeedShowProductsUpdateBanner(); void setIsNeedShowProductsUpdateBanner(boolean isNeedShowUpdateBanner, String primaryName); void removeShowUpdateBannerTextWhenReactiveProduct(String primaryName); Set<String> getShowUpdateBannerTexts(); void addShowUpdateBannerText(String productName); String getLatestPhysicInventoryTime(); void setLatestPhysicInventoryTime(String latestPhysicInventoryTime); long getRnrLastSyncTime(); void setRnrLastSyncTime(); long getStockLastSyncTime(); int getMonthOffsetThatDefinedOldData(); void setStockLastSyncTime(); void setKeyHasCopiedTrainingDb(boolean hasCopiedTrainingDb); boolean hasCopiedTrainingDb(); boolean hasSyncedUpLatestMovementLastDay(); void setLastMovementHandShakeDateToToday(); void setEnableQaDebug(boolean enabled); boolean isQaDebugEnabled(); DateTime getLatestUpdateLowStockAvgTime(); void updateLatestLowStockAvgTime(); void setHasDeletedOldStockMovement(boolean hasDeletedOldStockMovement); void setHasDeletedOldRnr(boolean hasDeletedOldRnr); boolean isRapidTestDataSynced(); void setRapidTestsDataSynced(boolean hasRapidTestsDataSynced); void setStockCardLastYearSyncError(boolean isSyncFailed); boolean isStockCardLastYearSyncError(); String getStockMovementSyncError(); void setStockMovementSyncError(String msg); long getLastUpdate(); void setLastUpdate(Long val); long getMd5Time(); void setMd5Time(Long val); String getMd5Key(); void setMd5Key(String val); String getUpdateFile(); void setUpdateFile(String val); void removeDownloadInfo(); void setLastestVersionCode(int val); void setDeletedProduct(List<String> products); List<String> getDeletedProduct(); void setUserFacilityId(String facilityId); String getUserFacilityId(); Date getCheckDataDate(); void setCheckDataDate(long time); static final String MY_PREFERENCE; static final String KEY_LAST_LOGIN_USER; static final String KEY_USER_FACILITY; static final String KEY_USER_FACILITY_ID; static final String KEY_STOCK_SYNC_END_TIME; static final String KEY_STOCK_SYNC_CURRENT_INDEX; static final String KEY_LAST_SYNC_PRODUCT_TIME; static final String KEY_LAST_SYNC_SERVICE_TIME; static final String KEY_SHOW_PRODUCT_UPDATE_BANNER; static final String KEY_PRODUCT_UPDATE_BANNER_TEXT; static final String LATEST_PHYSICAL_INVENTORY_TIME; static final String LAST_MOVEMENT_HANDSHAKE_DATE; static final String KEY_ENABLE_QA_DEBUG; static final String LATEST_UPDATE_LOW_STOCK_AVG_TIME; static final String KEY_HAS_LOT_INFO; static final String KEY_HAS_DELETED_OLD_STOCK_MOVEMENT; static final String KEY_HAS_DELETED_OLD_RNR; static final String KEY_HAS_SYNCED_DOWN_RAPID_TESTS; static final String LATEST_SYNCED_DOWN_REPORT_TYPE; static final String MONTH_OFFSET_DEFINED_OLD_DATA; static final String KEY_STOCK_CARD_LAST_YEAR_SYNC_ERROR; static final String KEY_STOCK_MOVENENT_SYNC_ERROR; static final String KEY_HAS_COPIED_TRAINING_DB; static final String KEY_LAST_UPDATE; static final String KEY_MD5_TIME; static final String KEY_MD5_KEY; static final String KEY_UPDATE_FILE; static final String KEY_SILENT_FAILED; static final String KEY_DOWNLOADED_LATEST_VERSIONCODE; static final String KEY_DELETED_THREE_PRODUCT; static final String KEY_DELETED_PRODUCT_TIME; }
@Test public void shouldGetRequisitionDataSyncedWhenHaveLocalData() throws Exception { when(rnrFormRepository.hasRequisitionData()).thenReturn(true); boolean requisitionDataSynced = sharedPreferenceMgr.isRequisitionDataSynced(); assertThat(requisitionDataSynced, is(true)); }