CustomEventBannerAdapter implements CustomEventBannerListener { @Override public void onBannerFailed(MoPubErrorCode errorCode) { if (isInvalidated()) return; if (mMoPubView != null) { if (errorCode == null) { errorCode = UNSPECIFIED; } cancelTimeout(); mMoPubView.loadFailUrl(errorCode); } } CustomEventBannerAdapter(MoPubView moPubView, String className, String classData); @Override void onBannerLoaded(View bannerView); @Override void onBannerFailed(MoPubErrorCode errorCode); @Override void onBannerExpanded(); @Override void onBannerCollapsed(); @Override void onBannerClicked(); @Override void onLeaveApplication(); static final int DEFAULT_BANNER_TIMEOUT_DELAY; }
@Test public void onBannerFailed_shouldLoadFailUrl() throws Exception { subject.onBannerFailed(ADAPTER_CONFIGURATION_ERROR); verify(moPubView).loadFailUrl(eq(ADAPTER_CONFIGURATION_ERROR)); }
@Test public void onBannerFailed_whenErrorCodeIsNull_shouldPassUnspecifiedError() throws Exception { subject.onBannerFailed(null); verify(moPubView).loadFailUrl(eq(UNSPECIFIED)); }