use of org.prebid.mobile.rendering.models.AdConfiguration 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.AdConfiguration in project prebid-mobile-android by prebid.
the class DisplayViewTest method setup.
@Before
public void setup() throws Exception {
MockitoAnnotations.initMocks(DisplayViewTest.this);
mContext = Robolectric.buildActivity(Activity.class).create().get();
mAdUnitConfiguration = new AdConfiguration();
mAdUnitConfiguration.setAdUnitIdentifierType(AdConfiguration.AdUnitIdentifierType.BANNER);
BidResponse mockResponse = mock(BidResponse.class);
Bid mockBid = mock(Bid.class);
when(mockBid.getAdm()).thenReturn("adm");
when(mockResponse.getWinningBid()).thenReturn(mockBid);
mDisplayView = new DisplayView(mContext, mMockDisplayViewListener, mAdUnitConfiguration, mockResponse);
reset(mMockDisplayViewListener);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class InterstitialControllerTest method loadAd_ExecuteInterstitialViewLoadAd.
@Test
public void loadAd_ExecuteInterstitialViewLoadAd() {
final AdConfiguration mockAdUnitConfiguration = mock(AdConfiguration.class);
final BidResponse mockBidResponse = mock(BidResponse.class);
mInterstitialController.loadAd(mockAdUnitConfiguration, mockBidResponse);
verify(mMockInterstitialView, times(1)).loadAd(eq(mockAdUnitConfiguration), eq(mockBidResponse));
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class MediationBannerAdUnitTest method whenInitAdConfig_PrepareAdConfigForBanner.
@Test
public void whenInitAdConfig_PrepareAdConfigForBanner() {
AdSize adSize = new AdSize(1, 2);
mMediationBannerAdUnit.initAdConfig("config", adSize);
AdConfiguration adConfiguration = mMediationBannerAdUnit.mAdUnitConfig;
assertEquals("config", adConfiguration.getConfigId());
assertEquals(AdConfiguration.AdUnitIdentifierType.BANNER, adConfiguration.getAdUnitIdentifierType());
assertTrue(adConfiguration.getAdSizes().contains(adSize));
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class MediationRewardedVideoAdUnitTest method whenInitAdConfig_PrepareAdConfigForInterstitial.
@Test
public void whenInitAdConfig_PrepareAdConfigForInterstitial() {
mMopubRewardedAdUnit.initAdConfig("config", null);
AdConfiguration adConfiguration = mMopubRewardedAdUnit.mAdUnitConfig;
assertEquals("config", adConfiguration.getConfigId());
assertEquals(AdConfiguration.AdUnitIdentifierType.VAST, adConfiguration.getAdUnitIdentifierType());
assertTrue(adConfiguration.isRewarded());
}
Aggregations