AdViewController { void loadNonJavascript(String url) { if (url == null) return; MoPubLog.d("Loading url: " + url); if (mIsLoading) { if (!TextUtils.isEmpty(mAdUnitId)) { MoPubLog.i("Already loading an ad for " + mAdUnitId + ", wait to finish."); } return; } mUrl = url; mIsLoading = true; fetchAd(mUrl); } AdViewController(@NonNull Context context, @NonNull MoPubView view); static void setShouldHonorServerDimensions(View view); @Nullable MoPubView getMoPubView(); void loadAd(); void reload(); String getKeywords(); void setKeywords(String keywords); Location getLocation(); void setLocation(Location location); String getAdUnitId(); void setAdUnitId(@NonNull String adUnitId); long getBroadcastIdentifier(); void setTimeout(int milliseconds); int getAdWidth(); int getAdHeight(); @Deprecated String getClickTrackingUrl(); @Deprecated String getRedirectUrl(); @Deprecated String getResponseString(); boolean getAutorefreshEnabled(); @Nullable AdReport getAdReport(); boolean getTesting(); void setTesting(boolean enabled); @Deprecated void customEventDidLoadAd(); @Deprecated void customEventDidFailToLoadAd(); @Deprecated void customEventActionWillBegin(); @Deprecated void setClickthroughUrl(String clickthroughUrl); @Deprecated boolean isFacebookSupported(); @Deprecated void setFacebookSupported(boolean enabled);  }
@Test public void loadNonJavascript_shouldFetchAd() throws Exception { String url = "http: subject.loadNonJavascript(url); verify(mockRequestQueue).add(argThat(isUrl(url))); }
@Test public void loadNonJavascript_whenAlreadyLoading_shouldNotFetchAd() throws Exception { String url = "http: subject.loadNonJavascript(url); reset(mockRequestQueue); subject.loadNonJavascript(url); verify(mockRequestQueue, never()).add(any(Request.class)); }
@Test public void loadNonJavascript_shouldAcceptNullParameter() throws Exception { subject.loadNonJavascript(null); }