SentenceListPresenter extends AbstractMvpPresenter<SentenceList.View, SentenceListViewModel> implements SentenceList.Presenter<SentenceList.View, SentenceListViewModel> { @Subscribe @Override public void onSentenceChanged(SentenceChangedEvent event) { LogUtils.v(Constants.TAG, "sentence changed, reload"); loadSentences(false); } SentenceListPresenter(); void setLoadSentencesUCAndHandler(LoadSentencesUC loadSentencesUC, UseCaseHandler useCaseHandler); void setUpdateFavoriteSentenceUCAndHandler(UpdateFavoriteSentenceUC updateFavoriteSentenceUC, UseCaseHandler useCaseHandler); @Override void loadSentences(final boolean firstLoad); @Override void openSentence(long sentenceId); @Override void setFavorite(@NonNull Sentence sentence, boolean favorite); @Override void onCreate(); @Override void onActivityCreated(); @Subscribe @Override void onSentenceChanged(SentenceChangedEvent event); @Override void setNeedAutoFocused(boolean needAutoFocused); @Override void onDestroy(); @VisibleForTesting EventBus getEventBus();  }
@Test public void testOnSentenceChanged() { mSentenceListPresenter.onSentenceChanged(new SentenceChangedEvent()); verify(mSentenceListPresenter).loadSentences(false); }