VastVideoInterstitial extends ResponseBodyInterstitial implements VastManager.VastManagerListener { @Override protected void preRenderHtml(CustomEventInterstitialListener customEventInterstitialListener) { mCustomEventInterstitialListener = customEventInterstitialListener; if (!CacheService.initializeDiskCache(mContext)) { mCustomEventInterstitialListener.onInterstitialFailed(MoPubErrorCode.VIDEO_CACHE_ERROR); return; } mVastManager = VastManagerFactory.create(mContext); mVastManager.prepareVastVideoConfiguration(mVastResponse, this); }  @Override void showInterstitial(); @Override void onInvalidate(); @Override void onVastVideoConfigurationPrepared(final VastVideoConfiguration vastVideoConfiguration);  }
@Test public void preRenderHtml_whenCreatingVideoCache_butItHasInitializationErrors_shouldSignalOnInterstitialFailedOnError() throws Exception { subject.preRenderHtml(customEventInterstitialListener); verify(customEventInterstitialListener).onInterstitialFailed(eq(MoPubErrorCode.VIDEO_CACHE_ERROR)); verify(vastManager, never()).prepareVastVideoConfiguration(anyString(), any(VastManagerListener.class)); }