@Test public void initializeWithMinimumScansRemainingToProvideHint() { when(ocrPurchaseTracker.getRemainingScansStream()).thenReturn(Observable.just(OcrInformationalTooltipInteractor.SCANS_LEFT_TO_INFORM)); interactor.initialize(); verify(stateTracker).setShouldShowOcrInfo(true); }
@SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") public void initialize() { ocrPurchaseTracker.getRemainingScansStream() .subscribeOn(scheduler) .subscribe(remainingScans -> { if (remainingScans == SCANS_LEFT_TO_INFORM) { Logger.info(OcrInformationalTooltipInteractor.this, "{} scans remaining. Re-enabling our few scans remaining tracker.", remainingScans); stateTracker.setShouldShowOcrInfo(true); } if (lastRemainingScans == 1 && remainingScans == 0) { Logger.info(OcrInformationalTooltipInteractor.this, "No scans. Re-enabling our few scans remaining tracker."); stateTracker.setShouldShowOcrInfo(true); } lastRemainingScans = remainingScans; }); }
OcrInformationalTooltipInteractor { @SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") public void initialize() { ocrPurchaseTracker.getRemainingScansStream() .subscribeOn(scheduler) .subscribe(remainingScans -> { if (remainingScans == SCANS_LEFT_TO_INFORM) { Logger.info(OcrInformationalTooltipInteractor.this, "{} scans remaining. Re-enabling our few scans remaining tracker.", remainingScans); stateTracker.setShouldShowOcrInfo(true); } if (lastRemainingScans == 1 && remainingScans == 0) { Logger.info(OcrInformationalTooltipInteractor.this, "No scans. Re-enabling our few scans remaining tracker."); stateTracker.setShouldShowOcrInfo(true); } lastRemainingScans = remainingScans; }); } }
OcrInformationalTooltipInteractor { @SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") public void initialize() { ocrPurchaseTracker.getRemainingScansStream() .subscribeOn(scheduler) .subscribe(remainingScans -> { if (remainingScans == SCANS_LEFT_TO_INFORM) { Logger.info(OcrInformationalTooltipInteractor.this, "{} scans remaining. Re-enabling our few scans remaining tracker.", remainingScans); stateTracker.setShouldShowOcrInfo(true); } if (lastRemainingScans == 1 && remainingScans == 0) { Logger.info(OcrInformationalTooltipInteractor.this, "No scans. Re-enabling our few scans remaining tracker."); stateTracker.setShouldShowOcrInfo(true); } lastRemainingScans = remainingScans; }); } @Inject  OcrInformationalTooltipInteractor(@NonNull Analytics analytics,
                                             @NonNull OcrInformationalTooltipStateTracker stateTracker,
                                             @NonNull OcrPurchaseTracker ocrPurchaseTracker,
                                             @NonNull IdentityManager identityManager,
                                             @NonNull ConfigurationManager configurationManager); @VisibleForTesting  OcrInformationalTooltipInteractor(@NonNull Analytics analytics,
                                      @NonNull OcrInformationalTooltipStateTracker stateTracker,
                                      @NonNull OcrPurchaseTracker ocrPurchaseTracker,
                                      @NonNull IdentityManager identityManager,
                                      @NonNull ConfigurationManager configurationManager,
                                      @NonNull Scheduler scheduler); }
OcrInformationalTooltipInteractor { @SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") public void initialize() { ocrPurchaseTracker.getRemainingScansStream() .subscribeOn(scheduler) .subscribe(remainingScans -> { if (remainingScans == SCANS_LEFT_TO_INFORM) { Logger.info(OcrInformationalTooltipInteractor.this, "{} scans remaining. Re-enabling our few scans remaining tracker.", remainingScans); stateTracker.setShouldShowOcrInfo(true); } if (lastRemainingScans == 1 && remainingScans == 0) { Logger.info(OcrInformationalTooltipInteractor.this, "No scans. Re-enabling our few scans remaining tracker."); stateTracker.setShouldShowOcrInfo(true); } lastRemainingScans = remainingScans; }); } @Inject  OcrInformationalTooltipInteractor(@NonNull Analytics analytics,
                                             @NonNull OcrInformationalTooltipStateTracker stateTracker,
                                             @NonNull OcrPurchaseTracker ocrPurchaseTracker,
                                             @NonNull IdentityManager identityManager,
                                             @NonNull ConfigurationManager configurationManager); @VisibleForTesting  OcrInformationalTooltipInteractor(@NonNull Analytics analytics,
                                      @NonNull OcrInformationalTooltipStateTracker stateTracker,
                                      @NonNull OcrPurchaseTracker ocrPurchaseTracker,
                                      @NonNull IdentityManager identityManager,
                                      @NonNull ConfigurationManager configurationManager,
                                      @NonNull Scheduler scheduler); @SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") void initialize(); @NonNull Observable<OcrTooltipMessageType> getShowOcrTooltip(); void markTooltipInteraction(); }
OcrInformationalTooltipInteractor { @SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") public void initialize() { ocrPurchaseTracker.getRemainingScansStream() .subscribeOn(scheduler) .subscribe(remainingScans -> { if (remainingScans == SCANS_LEFT_TO_INFORM) { Logger.info(OcrInformationalTooltipInteractor.this, "{} scans remaining. Re-enabling our few scans remaining tracker.", remainingScans); stateTracker.setShouldShowOcrInfo(true); } if (lastRemainingScans == 1 && remainingScans == 0) { Logger.info(OcrInformationalTooltipInteractor.this, "No scans. Re-enabling our few scans remaining tracker."); stateTracker.setShouldShowOcrInfo(true); } lastRemainingScans = remainingScans; }); } @Inject  OcrInformationalTooltipInteractor(@NonNull Analytics analytics,
                                             @NonNull OcrInformationalTooltipStateTracker stateTracker,
                                             @NonNull OcrPurchaseTracker ocrPurchaseTracker,
                                             @NonNull IdentityManager identityManager,
                                             @NonNull ConfigurationManager configurationManager); @VisibleForTesting  OcrInformationalTooltipInteractor(@NonNull Analytics analytics,
                                      @NonNull OcrInformationalTooltipStateTracker stateTracker,
                                      @NonNull OcrPurchaseTracker ocrPurchaseTracker,
                                      @NonNull IdentityManager identityManager,
                                      @NonNull ConfigurationManager configurationManager,
                                      @NonNull Scheduler scheduler); @SuppressLint("CheckResult") @SuppressWarnings("ResultOfMethodCallIgnored") void initialize(); @NonNull Observable<OcrTooltipMessageType> getShowOcrTooltip(); void markTooltipInteraction();  }