@Test public void should_show_error_when_fetch_fails() { ServiceException exception = new ServiceException(); when(repository.fetchResponse(any())).thenReturn(Single.error(exception)); presenter.onStart(); verify(view).setViewState(ViewState.Error.create(R.string.error_message)); }
@Override public void onStart() { setLoading(); binder.bind(getAnimals(), this::setAnimals, this::setError, this::setComplete); }
Presenter implements Contract.Presenter { @Override public void onStart() { setLoading(); binder.bind(getAnimals(), this::setAnimals, this::setError, this::setComplete); } }
Presenter implements Contract.Presenter { @Override public void onStart() { setLoading(); binder.bind(getAnimals(), this::setAnimals, this::setError, this::setComplete); } Presenter(@NonNull Repository repository,
                   @NonNull Contract.View view,
                   @NonNull RxBinder binder,
                   @NonNull Logger logger); }
Presenter implements Contract.Presenter { @Override public void onStart() { setLoading(); binder.bind(getAnimals(), this::setAnimals, this::setError, this::setComplete); } Presenter(@NonNull Repository repository,
                   @NonNull Contract.View view,
                   @NonNull RxBinder binder,
                   @NonNull Logger logger); @Override void onStart(); @Override void onStop(); }
Presenter implements Contract.Presenter { @Override public void onStart() { setLoading(); binder.bind(getAnimals(), this::setAnimals, this::setError, this::setComplete); } Presenter(@NonNull Repository repository,
                   @NonNull Contract.View view,
                   @NonNull RxBinder binder,
                   @NonNull Logger logger); @Override void onStart(); @Override void onStop();  }