MoPubActivity extends BaseInterstitialActivity { public static void start(Context context, String htmlData, boolean isScrollable, String redirectUrl, String clickthroughUrl, AdConfiguration adConfiguration) { Intent intent = createIntent(context, htmlData, isScrollable, redirectUrl, clickthroughUrl, adConfiguration); try { context.startActivity(intent); } catch (ActivityNotFoundException anfe) { Log.d("MoPubActivity", "MoPubActivity not found - did you declare it in AndroidManifest.xml?"); } }  static void start(Context context, String htmlData, boolean isScrollable, String redirectUrl, String clickthroughUrl, AdConfiguration adConfiguration); @Override View getAdView();  }
@Test public void start_shouldStartMoPubActivityWithCorrectParameters() throws Exception { MoPubActivity.start(subject, "expectedResponse", true, "redirectUrl", "clickthroughUrl", adConfiguration); Intent nextStartedActivity = Robolectric.getShadowApplication().getNextStartedActivity(); assertThat(nextStartedActivity.getStringExtra(HTML_RESPONSE_BODY_KEY)).isEqualTo("expectedResponse"); assertThat(nextStartedActivity.getBooleanExtra(SCROLLABLE_KEY, false)).isTrue(); assertThat(nextStartedActivity.getStringExtra(REDIRECT_URL_KEY)).isEqualTo("redirectUrl"); assertThat(nextStartedActivity.getStringExtra(CLICKTHROUGH_URL_KEY)).isEqualTo("clickthroughUrl"); assertThat(nextStartedActivity.getFlags() & Intent.FLAG_ACTIVITY_NEW_TASK).isNotEqualTo(0); assertThat(nextStartedActivity.getComponent().getClassName()).isEqualTo("com.mopub.mobileads.MoPubActivity"); }