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(@NonNull MoPubView moPubView,
            @NonNull String className,
            @NonNull Map<String, String> serverExtras,
            long broadcastIdentifier,
            @Nullable AdReport adReport); @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)); }