@Test public void shouldCreateSyncAccountWhenLoginSuccess() { presenter.startLogin("user", "password", false); verify(internetCheck1).execute(internetCheckCallBack.capture()); internetCheckCallBack.getValue().launchResponse(true); verify(mockedApi).authorizeUser(any(User.class), loginCB.capture()); loginCB.getValue().success(userResponse, retrofitResponse); verify(syncService).createSyncAccount(userResponse.getUserInformation()); }
public void startLogin(String userName, String password, boolean fromReSync) { hasGoneToNextPage = false; if (StringUtils.EMPTY.equals(userName.trim())) { view.showUserNameEmpty(); return; } if (StringUtils.EMPTY.equals(password)) { view.showPasswordEmpty(); return; } view.loading(); User user = new User(userName.trim(), password); if (!isRoboUniTest()) { new InternetCheck().execute(checkNetworkConnected(user, fromReSync)); } else { internetCheck.execute(checkNetworkConnected(user, fromReSync)); } }
LoginPresenter extends Presenter { public void startLogin(String userName, String password, boolean fromReSync) { hasGoneToNextPage = false; if (StringUtils.EMPTY.equals(userName.trim())) { view.showUserNameEmpty(); return; } if (StringUtils.EMPTY.equals(password)) { view.showPasswordEmpty(); return; } view.loading(); User user = new User(userName.trim(), password); if (!isRoboUniTest()) { new InternetCheck().execute(checkNetworkConnected(user, fromReSync)); } else { internetCheck.execute(checkNetworkConnected(user, fromReSync)); } } }
LoginPresenter extends Presenter { public void startLogin(String userName, String password, boolean fromReSync) { hasGoneToNextPage = false; if (StringUtils.EMPTY.equals(userName.trim())) { view.showUserNameEmpty(); return; } if (StringUtils.EMPTY.equals(password)) { view.showPasswordEmpty(); return; } view.loading(); User user = new User(userName.trim(), password); if (!isRoboUniTest()) { new InternetCheck().execute(checkNetworkConnected(user, fromReSync)); } else { internetCheck.execute(checkNetworkConnected(user, fromReSync)); } }  }
LoginPresenter extends Presenter { public void startLogin(String userName, String password, boolean fromReSync) { hasGoneToNextPage = false; if (StringUtils.EMPTY.equals(userName.trim())) { view.showUserNameEmpty(); return; } if (StringUtils.EMPTY.equals(password)) { view.showPasswordEmpty(); return; } view.loading(); User user = new User(userName.trim(), password); if (!isRoboUniTest()) { new InternetCheck().execute(checkNetworkConnected(user, fromReSync)); } else { internetCheck.execute(checkNetworkConnected(user, fromReSync)); } }  @Override void attachView(BaseView v); void startLogin(String userName, String password, boolean fromReSync); void onLoginFailed(); void syncLocalUserData(Subscriber<SyncLocalUserProgress> subscriber); @NonNull Subscriber<SyncLocalUserProgress> getSyncLocalUserDataSubscriber(); }
LoginPresenter extends Presenter { public void startLogin(String userName, String password, boolean fromReSync) { hasGoneToNextPage = false; if (StringUtils.EMPTY.equals(userName.trim())) { view.showUserNameEmpty(); return; } if (StringUtils.EMPTY.equals(password)) { view.showPasswordEmpty(); return; } view.loading(); User user = new User(userName.trim(), password); if (!isRoboUniTest()) { new InternetCheck().execute(checkNetworkConnected(user, fromReSync)); } else { internetCheck.execute(checkNetworkConnected(user, fromReSync)); } }  @Override void attachView(BaseView v); void startLogin(String userName, String password, boolean fromReSync); void onLoginFailed(); void syncLocalUserData(Subscriber<SyncLocalUserProgress> subscriber); @NonNull Subscriber<SyncLocalUserProgress> getSyncLocalUserDataSubscriber();  }