AnalysisScreenPresenter extends AnalysisScreenContract.Presenter { @Override public void showError(@NonNull final String message, final int duration) { getView().showErrorSnackbar(message, duration, null, null); } AnalysisScreenPresenter(
            @NonNull final Activity activity,
            @NonNull final AnalysisScreenContract.View view,
            @NonNull final Document document,
            @Nullable final String documentAnalysisErrorMessage); @VisibleForTesting  AnalysisScreenPresenter(
            @NonNull final Activity activity,
            @NonNull final AnalysisScreenContract.View view,
            @NonNull final Document document,
            @Nullable final String documentAnalysisErrorMessage,
            @NonNull final AnalysisInteractor analysisInteractor); @Override void hideError(); @Override void onNoExtractionsFound(); @Override void onDocumentAnalyzed(); @Override void showError(@NonNull final String message, final int duration); @Override void showError(@NonNull final String message, @NonNull final String buttonTitle,
            @NonNull final View.OnClickListener onClickListener); @Override void startScanAnimation(); @Override void stopScanAnimation(); @Override void setListener(@NonNull final AnalysisFragmentListener listener); @Override void start(); @Override void stop();  }
@Test public void should_showError() throws Exception { final AnalysisScreenPresenter presenter = createPresenterWithEmptyImageDocument(); final String message = "Error message"; final int duration = 1000; presenter.showError(message, duration); verify(mView).showErrorSnackbar(message, duration, null, null); }
@Test public void should_showError_withButtonTitle_andOnClickListener() throws Exception { final AnalysisScreenPresenter presenter = createPresenterWithEmptyImageDocument(); final String message = "Error message"; final String buttonTitle = "Retry"; final View.OnClickListener onClickListener = new View.OnClickListener() { @Override public void onClick(final View v) { } }; presenter.showError(message, buttonTitle, onClickListener); verify(mView).showErrorSnackbar(message, ErrorSnackbar.LENGTH_INDEFINITE, buttonTitle, onClickListener); }