AnalysisFragmentImpl extends AnalysisScreenContract.View { @Override void showScanAnimation() { mProgressActivity.setVisibility(View.VISIBLE); mAnalysisMessageTextView.setVisibility(View.VISIBLE); } AnalysisFragmentImpl(final FragmentImplCallback fragment,
            @NonNull final Document document,
            final String documentAnalysisErrorMessage); @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); void onCreate(final Bundle savedInstanceState); View onCreateView(final LayoutInflater inflater, final ViewGroup container,
            final Bundle savedInstanceState); void onStart(); void onDestroy();  }
@Test public void should_showScanAnimation_whenRequested() throws Exception { final AtomicReference<AnalysisFragmentImpl> analysisFragmentImplRef = new AtomicReference<>(); try (final ActivityScenario<AnalysisFragmentHostActivity> scenario = launchHostActivity( analysisFragmentImplRef)) { scenario.onActivity( new ActivityScenario.ActivityAction<AnalysisFragmentHostActivity>() { @Override public void perform(final AnalysisFragmentHostActivity activity) { final AnalysisFragmentImpl analysisFragment = analysisFragmentImplRef.get(); analysisFragment.showScanAnimation(); } }); onView(withId(R.id.gv_progress_activity)).check(matches( withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); onView(withId(R.id.gv_analysis_message)).check(matches( withEffectiveVisibility(ViewMatchers.Visibility.VISIBLE))); } }