ListingActivity extends ViperAiPassiveActivity<ListingContract.View> implements ListingContract.View, UserAdapter.UserClickListener { @Override public void showError(Throwable throwable) { mErrorViewTextView.setVisibility(View.VISIBLE); mLoadingViewProgressBar.setVisibility(View.INVISIBLE); mRecyclerView.setVisibility(View.INVISIBLE); mErrorViewTextView.setText(throwable.getLocalizedMessage()); }  static void start(Activity activity, String avatarUrl, ImageView avatarImageView); @Override Observable<User> getUserClicks(); @Override void setUserList(List<User> userList); @Override void onUserClick(User user); @Override void showError(Throwable throwable); @Override void showLoading(); @Override void showContent(); @NonNull @Override ViperPresenter<ListingContract.View> createPresenter(); static final String PHOTO_URL_EXTRA_STRING; }
@Test public void testShowError() throws Exception { mListingActivity.showError(new Exception("Test message")); assertFalse("Loading indicator is visible", mProgressBar.isShown()); assertFalse("content is visible", mRecyclerView.isShown()); assertTrue("Error textview is not visible", mErrorTextView.isShown()); assertEquals("Error textview hasn't got proper message", "Test message", mErrorTextView.getText().toString()); }