use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class BasicParameterBuilderTest method whenAppendParametersAndCoppaFalse_CoppaNull.
@Test
public void whenAppendParametersAndCoppaFalse_CoppaNull() {
AdConfiguration adConfiguration = new AdConfiguration();
adConfiguration.setAdUnitIdentifierType(AdConfiguration.AdUnitIdentifierType.BANNER);
adConfiguration.addSize(new AdSize(320, 50));
BasicParameterBuilder builder = new BasicParameterBuilder(adConfiguration, mContext.getResources(), mBrowserActivityAvailable);
AdRequestInput adRequestInput = new AdRequestInput();
builder.appendBuilderParameters(adRequestInput);
BidRequest actualBidRequest = adRequestInput.getBidRequest();
assertNull(actualBidRequest.getRegs().coppa);
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class BasicParameterBuilderTest method whenAppendParametersAndAdConfigContextDataNotEmpty_ContextDataAddedToImpExt.
@Test
public void whenAppendParametersAndAdConfigContextDataNotEmpty_ContextDataAddedToImpExt() throws JSONException {
AdConfiguration adConfiguration = new AdConfiguration();
adConfiguration.addContextData("context", "contextData");
BasicParameterBuilder builder = new BasicParameterBuilder(adConfiguration, mContext.getResources(), false);
AdRequestInput adRequestInput = new AdRequestInput();
builder.appendBuilderParameters(adRequestInput);
Ext impExt = adRequestInput.getBidRequest().getImp().get(0).getExt();
assertTrue(impExt.getMap().containsKey("context"));
JSONObject contextDataJson = ((JSONObject) impExt.getMap().get("context")).getJSONObject("data");
assertTrue(contextDataJson.has("context"));
assertEquals("contextData", contextDataJson.getJSONArray("context").get(0));
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class InterstitialAdUnitTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mContext = Robolectric.buildActivity(Activity.class).create().get();
mInterstitialAdUnit = new InterstitialAdUnit(mContext, CONFIGURATION_ID, AD_SIZE, mMockInterstitialEventHandler);
mInterstitialAdUnit.setInterstitialAdUnitListener(mMockInterstitialAdUnitListener);
WhiteBox.setInternalState(mInterstitialAdUnit, "mBidLoader", mMockBidLoader);
WhiteBox.setInternalState(mInterstitialAdUnit, "mInterstitialController", mMockInterstitialController);
final AdConfiguration adUnitConfig = mInterstitialAdUnit.mAdUnitConfig;
assertEquals(AdPosition.FULLSCREEN.getValue(), adUnitConfig.getAdPositionValue());
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class VideoViewTest method loadAd_vastXml_StopVisibilityTrackingChangeStateToUndefined.
@Test
public void loadAd_vastXml_StopVisibilityTrackingChangeStateToUndefined() {
changeVideoViewState(PAUSED_AUTO);
mVideoView.loadAd(new AdConfiguration(), "somexml");
VideoView.State stateAfterLoad = WhiteBox.getInternalState(mVideoView, "mVideoViewState");
assertEquals(UNDEFINED, stateAfterLoad);
verify(mMockVisibilityTracker).stopVisibilityCheck();
}
use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.
the class RewardedAdUnitTest method setup.
@Before
public void setup() {
MockitoAnnotations.initMocks(this);
mContext = Robolectric.buildActivity(Activity.class).create().get();
mRewardedAdUnit = new RewardedAdUnit(mContext, CONFIGURATION_ID, mMockRewardedEventHandler);
mRewardedAdUnit.setRewardedAdUnitListener(mMockRewardedAdUnitListener);
WhiteBox.setInternalState(mRewardedAdUnit, "mBidLoader", mMockBidLoader);
WhiteBox.setInternalState(mRewardedAdUnit, "mInterstitialController", mMockInterstitialController);
final AdConfiguration adUnitConfig = mRewardedAdUnit.mAdUnitConfig;
assertEquals(AdPosition.FULLSCREEN.getValue(), adUnitConfig.getAdPositionValue());
}
Aggregations