use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class BidRequesterTest method setUp.
@Before
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
mContext = Robolectric.buildActivity(Activity.class).create().get();
mAdConfiguration = new AdConfiguration();
mAdRequestInput = new AdRequestInput();
ManagersResolver.getInstance().prepare(mContext);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class VideoCreative method createCreativeView.
// Helper method to reduce duplicate code in the subclass RewardedVideoCreative
private void createCreativeView() throws AdException {
Uri videoUri = null;
final Context context = mContextReference.get();
if (context != null) {
final AdConfiguration adConfiguration = mModel.getAdConfiguration();
mVideoCreativeView = new VideoCreativeView(context, this);
mVideoCreativeView.setBroadcastId(adConfiguration.getBroadcastId());
// Get the preloaded video from device file storage
videoUri = Uri.parse(context.getFilesDir() + (mModel.getMediaUrl()));
}
// Show call-to-action overlay right away if click through url is available & end card is not available
showCallToAction();
mVideoCreativeView.setCallToActionUrl(mModel.getVastClickthroughUrl());
mVideoCreativeView.setVastVideoDuration(getMediaDuration());
mVideoCreativeView.setVideoUri(videoUri);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class MediationInterstitialAdUnitTest method whenInitAdConfig_PrepareAdConfigForInterstitial.
@Test
public void whenInitAdConfig_PrepareAdConfigForInterstitial() {
AdSize adSize = new AdSize(1, 2);
mMediationInterstitialAdUnit.initAdConfig("config", adSize);
AdConfiguration adConfiguration = mMediationInterstitialAdUnit.mAdUnitConfig;
assertEquals("config", adConfiguration.getConfigId());
assertEquals(AdConfiguration.AdUnitIdentifierType.INTERSTITIAL, adConfiguration.getAdUnitIdentifierType());
assertEquals(adSize, adConfiguration.getMinSizePercentage());
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class VideoViewTest method loadAd_LoadBidTransaction.
@Test
public void loadAd_LoadBidTransaction() {
final AdConfiguration adUnitConfiguration = new AdConfiguration();
final BidResponse bidResponse = new BidResponse("");
mVideoView.loadAd(adUnitConfiguration, bidResponse);
verify(mMockAdViewManager).loadBidTransaction(adUnitConfiguration, bidResponse);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class BaseInterstitialAdUnitTest method setUp.
@Before
public void setUp() throws Exception {
Context context = Robolectric.buildActivity(Activity.class).create().get();
mBaseInterstitialAdUnit = new BaseInterstitialAdUnit(context) {
@Override
void requestAdWithBid(@Nullable Bid bid) {
}
@Override
void showGamAd() {
}
@Override
void notifyAdEventListener(AdListenerEvent adListenerEvent) {
}
@Override
void notifyErrorListener(AdException exception) {
}
};
final AdConfiguration adUnitConfiguration = new AdConfiguration();
mBaseInterstitialAdUnit.init(adUnitConfiguration);
assertEquals(AdPosition.FULLSCREEN.getValue(), adUnitConfiguration.getAdPositionValue());
}
Aggregations