PostPresenter extends BasePresenter { public void refresh() { refresh(mStoryType, mStoryTypeSpec); } PostPresenter();  PostPresenter(@NonNull PostView postView);  PostPresenter(@NonNull PostView postView, @NonNull DataManager dataManager,
                         @NonNull SharedPrefsContract prefsManager, @NonNull UtilsContract utils); void setView(PostView postView); void setDataManager(DataManager dataManager); void setPrefsManager(SharedPrefsContract sharedPrefsContract); void setUtils(UtilsContract utils); void setStoryType(String storyType); void setStoryTypeSpec(String storyTypeSpec); @Override void setup(); @Override void restoreState(Bundle savedInstanceState); @Override void saveState(Bundle outState); @Override void destroy(); @Override void unsubscribe(); void refresh(); void refresh(@NonNull String type, @NonNull String spec); void loadPostIdList(String storyTypeUrl); void loadPostIdListBySearch(String timeRangeCombine, int page); void loadPosts(List<Long> list, boolean updateObservable); void updateCachedPostList(); List<Post> getCachedPosts(); void updateLoadingState(int loadingState); void loadMore(); void reload(); void setShowPostSummaryPref(); void refreshPostSummaryPref(); static final String TAG; }
@Test public void refreshWhenOffline() { when(mUtils.isOnline()).thenReturn(false); mPresenter.refresh(); verify(mPostView).hideSwipeRefresh(); verify(mPostView).showOfflineSnackBar(); }