ReaderViewPresenter extends BasePresenter<ReaderView> implements TTSPlayerFragment.OnTTSStopSpeakListener { void onResume() { ReaderView view = getView(); view.setKeepScreen(preferenceHelper.getBoolean("DisableTurnScreen")); view.setCurrentOrientation(preferenceHelper.getBoolean("DisableAutoScreenRotation")); } @Inject  ReaderViewPresenter(Librarian librarian, PreferenceHelper prefHelper, AnalyticsHelper helper); @Override void onStopSpeak(); @Override void onViewCreated();  }
@Test public void onResume() throws Exception { when(preferenceHelper.getBoolean(eq("DisableTurnScreen"))).thenReturn(false); when(preferenceHelper.getBoolean(eq("DisableAutoScreenRotation"))).thenReturn(true); presenter.onResume(); verify(view).setKeepScreen(eq(false)); verify(view).setCurrentOrientation(eq(true)); }