@@ -0,0 +1,2341 @@
+package io.github.plastix.forage.ui.login;%0A%0Aimport android.net.Uri;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0A%0Aimport io.github.plastix.forage.data.api.auth.OAuthInteractor;%0Aimport rx.Completable;%0Aimport rx.Single;%0A%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.mock;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.verifyNoMoreInteractions;%0Aimport static org.mockito.Mockito.when;%0A%0Apublic class LoginPresenterTest %7B%0A%0A    private LoginPresenter presenter;%0A%0A    @Mock%0A    private LoginView loginView;%0A%0A    @Mock%0A    private OAuthInteractor oAuthInteractor;%0A%0A    @Before%0A    public void beforeEachTest() %7B%0A        MockitoAnnotations.initMocks(this);%0A        presenter = new LoginPresenter(oAuthInteractor);%0A        presenter.onViewAttached(loginView);%0A%0A    %7D%0A%0A    @Test%0A    public void startOAuth_opensBrowserOnSuccess() %7B%0A        String OAUTH_CALLBACK = %22Redirect URL%22;%0A        when(oAuthInteractor.retrieveRequestToken()).thenReturn(Single.just(OAUTH_CALLBACK));%0A%0A        presenter.startOAuth();%0A%0A        verify(loginView, times(1)).openBrowser(OAUTH_CALLBACK);%0A        verifyNoMoreInteractions(loginView);%0A    %7D%0A%0A    @Test%0A    public void startOAuth_errorReturnedToView() %7B%0A        when(oAuthInteractor.retrieveRequestToken()).%0A                thenReturn(Single.error(new Throwable(%22Error!%22)));%0A%0A        presenter.startOAuth();%0A%0A        verify(loginView, times(1)).onErrorRequestToken();%0A        verifyNoMoreInteractions(loginView);%0A    %7D%0A%0A    @Test%0A    public void oauthCallback_onSuccessCallsView() %7B%0A        when(oAuthInteractor.retrieveAccessToken(any(Uri.class))).thenReturn(Completable.complete());%0A%0A        Uri uri = mock(Uri.class);%0A        presenter.oauthCallback(uri);%0A%0A        verify(loginView, times(1)).onAuthSuccess();%0A        verifyNoMoreInteractions(loginView);%0A    %7D%0A%0A    @Test%0A    public void oauthCallback_onErrorCallsView() %7B%0A        when(oAuthInteractor.retrieveAccessToken(any(Uri.class))).%0A                thenReturn(Completable.error(new Throwable(%22Error~%22)));%0A%0A        Uri uri = mock(Uri.class);%0A        presenter.oauthCallback(uri);%0A%0A        verify(loginView, times(1)).onErrorAccessToken();%0A        verifyNoMoreInteractions(loginView);%0A    %7D%0A%7D%0A%0A

Add LoginPresenter unit tests