@Test public void showImportInfoForImage() { when(intentImportProcessor.getLastResult()).thenReturn(Observable.just(Optional.of(new IntentImportResult(fakeUri, FileType.Image)))); manager.needToShowImportInfo() .test() .assertComplete() .assertNoErrors() .assertValueCount(1) .assertValue(true); }
public Observable<Boolean> needToShowImportInfo() { return intentImportProcessor.getLastResult() .map(intentImportResultOptional -> { if (intentImportResultOptional.isPresent()) { final FileType fileType = intentImportResultOptional.get().getFileType(); return fileType == FileType.Image || fileType == FileType.Pdf; } else { return false; } }); }
ImportInfoTooltipManager implements TooltipManager { public Observable<Boolean> needToShowImportInfo() { return intentImportProcessor.getLastResult() .map(intentImportResultOptional -> { if (intentImportResultOptional.isPresent()) { final FileType fileType = intentImportResultOptional.get().getFileType(); return fileType == FileType.Image || fileType == FileType.Pdf; } else { return false; } }); } }
ImportInfoTooltipManager implements TooltipManager { public Observable<Boolean> needToShowImportInfo() { return intentImportProcessor.getLastResult() .map(intentImportResultOptional -> { if (intentImportResultOptional.isPresent()) { final FileType fileType = intentImportResultOptional.get().getFileType(); return fileType == FileType.Image || fileType == FileType.Pdf; } else { return false; } }); } @Inject  ImportInfoTooltipManager(@NonNull IntentImportProcessor intentImportProcessor, @NonNull IntentImportProvider intentImportProvider); }
ImportInfoTooltipManager implements TooltipManager { public Observable<Boolean> needToShowImportInfo() { return intentImportProcessor.getLastResult() .map(intentImportResultOptional -> { if (intentImportResultOptional.isPresent()) { final FileType fileType = intentImportResultOptional.get().getFileType(); return fileType == FileType.Image || fileType == FileType.Pdf; } else { return false; } }); } @Inject  ImportInfoTooltipManager(@NonNull IntentImportProcessor intentImportProcessor, @NonNull IntentImportProvider intentImportProvider); Observable<Boolean> needToShowImportInfo(); @Override void tooltipWasDismissed(); }
ImportInfoTooltipManager implements TooltipManager { public Observable<Boolean> needToShowImportInfo() { return intentImportProcessor.getLastResult() .map(intentImportResultOptional -> { if (intentImportResultOptional.isPresent()) { final FileType fileType = intentImportResultOptional.get().getFileType(); return fileType == FileType.Image || fileType == FileType.Pdf; } else { return false; } }); } @Inject  ImportInfoTooltipManager(@NonNull IntentImportProcessor intentImportProcessor, @NonNull IntentImportProvider intentImportProvider); Observable<Boolean> needToShowImportInfo(); @Override void tooltipWasDismissed();  }