fix the exception test.
Project: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/commit/155eba6d Tree: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/tree/155eba6d Diff: http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/diff/155eba6d Branch: refs/heads/master Commit: 155eba6deb4a0c73c0f160c6d111b4381a320538 Parents: 8cdbc03 Author: Sagar <kumarsagar15...@gmail.com> Authored: Sat Aug 11 12:16:59 2018 +0530 Committer: Sagar <kumarsagar15...@gmail.com> Committed: Sat Aug 11 12:16:59 2018 +0530 ---------------------------------------------------------------------- .../java/org/apache/taverna/mobile/login/LoginActivityTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-taverna-mobile/blob/155eba6d/app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java ---------------------------------------------------------------------- diff --git a/app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java b/app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java index acc2e8a..c6b268f 100644 --- a/app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java +++ b/app/src/androidTest/java/org/apache/taverna/mobile/login/LoginActivityTest.java @@ -40,11 +40,13 @@ import android.support.test.rule.ActivityTestRule; import android.support.test.runner.AndroidJUnit4; import io.reactivex.Observable; +import retrofit2.HttpException; import static android.os.SystemClock.sleep; import static android.support.test.espresso.Espresso.onView; import static android.support.test.espresso.action.ViewActions.click; import static android.support.test.espresso.action.ViewActions.closeSoftKeyboard; +import static android.support.test.espresso.action.ViewActions.scrollTo; import static android.support.test.espresso.action.ViewActions.typeText; import static android.support.test.espresso.assertion.ViewAssertions.matches; import static android.support.test.espresso.matcher.ViewMatchers.isDisplayed; @@ -118,8 +120,7 @@ public class LoginActivityTest { testUser = new User(); Mockito.when(component.getMockDataManager() .getLoginUserDetail("Basic cG9zdG1hbjpwYXNzd29yZA==", true)) - .thenReturn(Observable.just(testUser)) - .thenThrow(new RuntimeException("runtime exception")); + .thenReturn(Observable.<User>error(new Throwable())); mLoginActivityActivityTestRule.launchActivity(null); onView(withId(R.id.etEmail))