@Test public void prepareVastVideoConfiguration_withExtensionsUnderWrapper_shouldContainTheCorrectCustomExtensionValues() throws Exception { mFakeHttpLayer.addPendingHttpResponse(200, TEST_NESTED_VAST_XML_STRING); mFakeHttpLayer.addPendingHttpResponse(200, "video_data"); subject.prepareVastVideoConfiguration( TEST_VAST_XML_STRING.replace(EXTENSIONS_SNIPPET_PLACEHOLDER, "<Extensions>" + "<Extension type=\"MoPub\">" + "<MoPubCtaText>custom CTA text</MoPubCtaText>" + "<MoPubSkipText>skip</MoPubSkipText>" + "<MoPubCloseIcon>http: "<MoPubForceOrientation>device</MoPubForceOrientation>" + "</Extension>" + "</Extensions>"), vastManagerListener); Robolectric.runBackgroundTasks(); Robolectric.runUiThreadTasks(); semaphore.acquire(); verify(vastManagerListener).onVastVideoConfigurationPrepared(any(VastVideoConfiguration.class)); assertThat(vastVideoConfiguration.getCustomCtaText()).isEqualTo("custom CTA text"); assertThat(vastVideoConfiguration.getCustomSkipText()).isEqualTo("skip"); assertThat(vastVideoConfiguration.getCustomCloseIconUrl()).isEqualTo("http: assertThat(vastVideoConfiguration.getCustomForceOrientation()).isEqualTo(DeviceUtils.ForceOrientation.DEVICE_ORIENTATION); }
public void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener) { if (mVastXmlManagerAggregator == null) { mVastManagerListener = vastManagerListener; mVastXmlManagerAggregator = new VastXmlManagerAggregator(this); try { AsyncTasks.safeExecuteOnExecutor(mVastXmlManagerAggregator, vastXml); } catch (Exception e) { MoPubLog.d("Failed to aggregate vast xml", e); mVastManagerListener.onVastVideoConfigurationPrepared(null); } } }
VastManager implements VastXmlManagerAggregatorListener { public void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener) { if (mVastXmlManagerAggregator == null) { mVastManagerListener = vastManagerListener; mVastXmlManagerAggregator = new VastXmlManagerAggregator(this); try { AsyncTasks.safeExecuteOnExecutor(mVastXmlManagerAggregator, vastXml); } catch (Exception e) { MoPubLog.d("Failed to aggregate vast xml", e); mVastManagerListener.onVastVideoConfigurationPrepared(null); } } } }
VastManager implements VastXmlManagerAggregatorListener { public void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener) { if (mVastXmlManagerAggregator == null) { mVastManagerListener = vastManagerListener; mVastXmlManagerAggregator = new VastXmlManagerAggregator(this); try { AsyncTasks.safeExecuteOnExecutor(mVastXmlManagerAggregator, vastXml); } catch (Exception e) { MoPubLog.d("Failed to aggregate vast xml", e); mVastManagerListener.onVastVideoConfigurationPrepared(null); } } } VastManager(final Context context); }
VastManager implements VastXmlManagerAggregatorListener { public void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener) { if (mVastXmlManagerAggregator == null) { mVastManagerListener = vastManagerListener; mVastXmlManagerAggregator = new VastXmlManagerAggregator(this); try { AsyncTasks.safeExecuteOnExecutor(mVastXmlManagerAggregator, vastXml); } catch (Exception e) { MoPubLog.d("Failed to aggregate vast xml", e); mVastManagerListener.onVastVideoConfigurationPrepared(null); } } } VastManager(final Context context); void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener); void cancel(); @Override void onAggregationComplete(final List<VastXmlManager> vastXmlManagers); }
VastManager implements VastXmlManagerAggregatorListener { public void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener) { if (mVastXmlManagerAggregator == null) { mVastManagerListener = vastManagerListener; mVastXmlManagerAggregator = new VastXmlManagerAggregator(this); try { AsyncTasks.safeExecuteOnExecutor(mVastXmlManagerAggregator, vastXml); } catch (Exception e) { MoPubLog.d("Failed to aggregate vast xml", e); mVastManagerListener.onVastVideoConfigurationPrepared(null); } } } VastManager(final Context context); void prepareVastVideoConfiguration(final String vastXml, final VastManagerListener vastManagerListener); void cancel(); @Override void onAggregationComplete(final List<VastXmlManager> vastXmlManagers);  }