VastVideoInterstitial extends ResponseBodyInterstitial implements VastManager.VastManagerListener { @Override public void onVastVideoConfigurationPrepared(final VastVideoConfiguration vastVideoConfiguration) { if (vastVideoConfiguration == null) { mCustomEventInterstitialListener.onInterstitialFailed(MoPubErrorCode.VIDEO_DOWNLOAD_ERROR); return; } mVastVideoConfiguration = vastVideoConfiguration; mCustomEventInterstitialListener.onInterstitialLoaded(); }  @Override void showInterstitial(); @Override void onInvalidate(); @Override void onVastVideoConfigurationPrepared(final VastVideoConfiguration vastVideoConfiguration);  }
@Test public void onVastVideoConfigurationPrepared_withVastVideoConfiguration_shouldSignalOnInterstitialLoaded() throws Exception { subject.loadInterstitial(context, customEventInterstitialListener, localExtras, serverExtras); ((VastVideoInterstitial) subject).onVastVideoConfigurationPrepared(mock(VastVideoConfiguration.class)); verify(customEventInterstitialListener).onInterstitialLoaded(); }
@Test public void onVastVideoConfigurationPrepared_withNullVastVideoConfiguration_shouldSignalOnInterstitialFailed() throws Exception { subject.loadInterstitial(context, customEventInterstitialListener, localExtras, serverExtras); ((VastVideoInterstitial) subject).onVastVideoConfigurationPrepared(null); verify(customEventInterstitialListener).onInterstitialFailed(MoPubErrorCode.VIDEO_DOWNLOAD_ERROR); }