LoginPresenter extends BasePresenter<LoginPresenter.ViewContract> implements Bundleable { private void hideLoading() { isLoading = false; if(hasView()) { view.hideLoading(); } } @Inject  LoginPresenter(); void updateUsername(String username); void updatePassword(String password); void login(); @Override Bundle toBundle(); @Override void fromBundle(@Nullable Bundle bundle);  }
@Test public void initializeViewWhileNotLoading() throws Exception { loginPresenter.username = "Hello"; loginPresenter.password = "World"; LoginPresenter.isLoading = false; loginPresenter.attachView(viewContract); Mockito.verify(viewContract).setUsername("Hello"); Mockito.verify(viewContract).setPassword("World"); Mockito.verify(viewContract).hideLoading(); }