use of org.prebid.mobile.rendering.models.openrtb.BidRequest in project prebid-mobile-android by prebid.
the class AutoDetectedOpenRtbTest method overwrittenAppInfoParameterBuilder.
@Test
public void overwrittenAppInfoParameterBuilder() {
mOriginalOpenRtbParams.getApp().name = "foo";
mOriginalOpenRtbParams.getApp().bundle = "foo";
mOriginalOpenRtbParams.getDevice().ifa = "foo";
mOriginalOpenRtbParams.getDevice().lmt = 0;
AppInfoManager.setAppName("bar");
AppInfoManager.setPackageName("bar");
AdIdManager.setAdId("bar");
AdIdManager.setLimitAdTrackingEnabled(true);
mParamBuilderArray.add(new AppInfoParameterBuilder(new AdConfiguration()));
AdRequestInput newAdRequestInput = URLBuilder.buildParameters(mParamBuilderArray, mOriginalAdRequestInput);
BidRequest newOpenRtbParams = newAdRequestInput.getBidRequest();
assertNotEquals(mOriginalOpenRtbParams.getApp().name, newOpenRtbParams.getApp().name);
assertNotEquals(mOriginalOpenRtbParams.getApp().bundle, newOpenRtbParams.getApp().bundle);
assertNotEquals(mOriginalOpenRtbParams.getDevice().ifa, newOpenRtbParams.getDevice().ifa);
assertNotEquals(mOriginalOpenRtbParams.getDevice().lmt, newOpenRtbParams.getDevice().lmt);
}
use of org.prebid.mobile.rendering.models.openrtb.BidRequest in project prebid-mobile-android by prebid.
the class BasicParameterBuilderTest method whenAppendParametersAndBInterstitialType_ImpWithValidBannerObject.
@Test
public void whenAppendParametersAndBInterstitialType_ImpWithValidBannerObject() throws JSONException {
AdConfiguration adConfiguration = new AdConfiguration();
adConfiguration.setAdUnitIdentifierType(AdConfiguration.AdUnitIdentifierType.INTERSTITIAL);
adConfiguration.setAdPosition(AdPosition.FULLSCREEN);
BasicParameterBuilder builder = new BasicParameterBuilder(adConfiguration, mContext.getResources(), mBrowserActivityAvailable);
AdRequestInput adRequestInput = new AdRequestInput();
builder.appendBuilderParameters(adRequestInput);
BidRequest actualBidRequest = adRequestInput.getBidRequest();
BidRequest expectedBidRequest = getExpectedBidRequest(adConfiguration, actualBidRequest.getId());
assertEquals(expectedBidRequest.getJsonObject().toString(), actualBidRequest.getJsonObject().toString());
Imp actualImp = actualBidRequest.getImp().get(0);
assertNotNull(actualImp.banner);
Format expectedFormat = new Format(1920, 1080);
assertTrue(actualImp.banner.getFormats().contains(expectedFormat));
assertNull(actualImp.video);
assertEquals(1, actualImp.secure.intValue());
assertEquals(1, actualImp.instl.intValue());
}
use of org.prebid.mobile.rendering.models.openrtb.BidRequest 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.openrtb.BidRequest in project prebid-mobile-android by prebid.
the class UserConsentParameterBuilder method appendBuilderParameters.
@Override
public void appendBuilderParameters(AdRequestInput adRequestInput) {
BidRequest bidRequest = adRequestInput.getBidRequest();
appendGdprParameter(bidRequest);
appendCcpaParameter(bidRequest);
}
Aggregations