mConnectionMockFactory.setTimeout(2900); mActivityRule.launchActivity(new Intent()); sleep(4000); check_messageIsShown(); } @Test public void test_whenDownloadExceededTimeout_dismissMessageAfterAppLaunch() throws Throwable { setup(new JSONArray(Arrays.asList(createDialogMessage("")))); mConnectionMockFactory.setTimeout(3100); mActivityRule.launchActivity(new Intent()); sleep(4000); check_messageIsDismissed(); } ‣