use of org.prebid.mobile.rendering.models.AbstractCreative in project prebid-mobile-android by prebid.
the class AdViewManagerTest method hideTest.
@Test
public void hideTest() throws IllegalAccessException {
AbstractCreative mockCreative = mock(AbstractCreative.class);
mAdViewManager.hide();
verify(mockAdView, never()).removeView(any(View.class));
WhiteBox.field(AdViewManager.class, "mCurrentCreative").set(mAdViewManager, mockCreative);
mAdViewManager.hide();
verify(mockAdView).removeView(any());
}
use of org.prebid.mobile.rendering.models.AbstractCreative in project prebid-mobile-android by prebid.
the class CreativeFactoryTest method testAttemptAuidCreative.
@Test
public void testAttemptAuidCreative() throws Exception {
AdConfiguration adConfiguration = new AdConfiguration();
adConfiguration.setAdUnitIdentifierType(AdConfiguration.AdUnitIdentifierType.BANNER);
Handler mockHandler = mock(Handler.class);
when(mMockModel.getAdConfiguration()).thenReturn(adConfiguration);
when(mMockModel.getName()).thenReturn(HTML_CREATIVE_TAG);
when(mMockModel.getImpressionUrl()).thenReturn("impressionUrl");
when(mMockModel.getClickUrl()).thenReturn("clickUrl");
// Run the creativeFactory
CreativeFactory creativeFactory = new CreativeFactory(mMockContext, mMockModel, mMockListener, mMockOmAdSessionManager, mMockInterstitialManager);
WhiteBox.field(CreativeFactory.class, "mTimeoutHandler").set(creativeFactory, mockHandler);
creativeFactory.start();
AbstractCreative creative = creativeFactory.getCreative();
assertNotNull(creative);
assertTrue(creative instanceof HTMLCreative);
verify(mockHandler).postDelayed(any(Runnable.class), eq(6_000L));
}
use of org.prebid.mobile.rendering.models.AbstractCreative in project prebid-mobile-android by prebid.
the class AdViewManager method show.
public void show() {
if (!isCreativeResolved()) {
LogUtil.debug(TAG, "Couldn't proceed show(): Video or HTML is not resolved.");
return;
}
AbstractCreative creative = mTransactionManager.getCurrentCreative();
if (creative == null) {
LogUtil.error(TAG, "Show called with no ad");
return;
}
// Display current creative
mCurrentCreative = creative;
mCurrentCreative.setCreativeViewListener(this);
handleCreativeDisplay();
}
Aggregations