@Override public void onResult(Contact result) { getView().showContactData(presentationContactMapper.map(result)); } }).error(GetContactError.class, new InteractorResult<InteractorError>() {
public void onResume() { obtainContact(); }
@Test public void show_get_contact_error_when_obtain_contact_fails() throws Exception { when(getContactInteractor.call()).thenReturn(ERROR_RESPONSE); presenter.onResume(); verify(view).showGetContactError(); } }
@Test public void show_contact_data_when_obtain_contact_success() { when(getContactInteractor.call()).thenReturn(CONTACT_RESPONSE); presenter.onResume(); verify(view).showContactData(any(PresentationContact.class)); }
@Before public void setUp() { presenter = new DetailPresenter(MD5, TestInteractorInvoker.create(), getContactInteractor, mapper, new TestViewInjector()); presenter.attachView(view); }
@Override public void onResult(InteractorError result) { getView().showGetContactError(); } }).execute(interactorInvoker);