@Test public void testLoadDatabaseClientPayload() { when(mDataManagerClient.getAllDatabaseClientPayload()).thenReturn(Observable.just (clientPayloads)); syncClientPayloadsPresenter.loadDatabaseClientPayload(); verify(mSyncClientPayloadsMvpView).showPayloads(clientPayloads); verify(mSyncClientPayloadsMvpView, never()) .showError(R.string.failed_to_load_clientpayload); }
public void loadDatabaseClientPayload() { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerClient.getAllDatabaseClientPayload() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<ClientPayload>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(R.string.failed_to_load_clientpayload); } @Override public void onNext(List<ClientPayload> clientPayloads) { getMvpView().showProgressbar(false); getMvpView().showPayloads(clientPayloads); } })); }
SyncClientPayloadsPresenter extends BasePresenter<SyncClientPayloadsMvpView> { public void loadDatabaseClientPayload() { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerClient.getAllDatabaseClientPayload() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<ClientPayload>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(R.string.failed_to_load_clientpayload); } @Override public void onNext(List<ClientPayload> clientPayloads) { getMvpView().showProgressbar(false); getMvpView().showPayloads(clientPayloads); } })); } }
SyncClientPayloadsPresenter extends BasePresenter<SyncClientPayloadsMvpView> { public void loadDatabaseClientPayload() { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerClient.getAllDatabaseClientPayload() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<ClientPayload>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(R.string.failed_to_load_clientpayload); } @Override public void onNext(List<ClientPayload> clientPayloads) { getMvpView().showProgressbar(false); getMvpView().showPayloads(clientPayloads); } })); } @Inject  SyncClientPayloadsPresenter(DataManagerClient dataManagerClient); }
SyncClientPayloadsPresenter extends BasePresenter<SyncClientPayloadsMvpView> { public void loadDatabaseClientPayload() { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerClient.getAllDatabaseClientPayload() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<ClientPayload>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(R.string.failed_to_load_clientpayload); } @Override public void onNext(List<ClientPayload> clientPayloads) { getMvpView().showProgressbar(false); getMvpView().showPayloads(clientPayloads); } })); } @Inject  SyncClientPayloadsPresenter(DataManagerClient dataManagerClient); @Override void attachView(SyncClientPayloadsMvpView mvpView); @Override void detachView(); void loadDatabaseClientPayload(); void syncClientPayload(ClientPayload clientPayload); void deleteAndUpdateClientPayload(int id, long clientCreationTIme); void updateClientPayload(ClientPayload clientPayload); }
SyncClientPayloadsPresenter extends BasePresenter<SyncClientPayloadsMvpView> { public void loadDatabaseClientPayload() { checkViewAttached(); getMvpView().showProgressbar(true); mSubscriptions.add(mDataManagerClient.getAllDatabaseClientPayload() .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<ClientPayload>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(R.string.failed_to_load_clientpayload); } @Override public void onNext(List<ClientPayload> clientPayloads) { getMvpView().showProgressbar(false); getMvpView().showPayloads(clientPayloads); } })); } @Inject  SyncClientPayloadsPresenter(DataManagerClient dataManagerClient); @Override void attachView(SyncClientPayloadsMvpView mvpView); @Override void detachView(); void loadDatabaseClientPayload(); void syncClientPayload(ClientPayload clientPayload); void deleteAndUpdateClientPayload(int id, long clientCreationTIme); void updateClientPayload(ClientPayload clientPayload);  }