use of org.prebid.mobile.rendering.models.openrtb.bidRequests.Ext in project prebid-mobile-android by prebid.
the class BasicParameterBuilderTest method getExpectedUser.
private User getExpectedUser() {
final User user = new User();
user.id = USER_ID;
user.yob = USER_YOB;
user.keywords = USER_KEYWORDS;
user.customData = USER_CUSTOM;
user.gender = USER_GENDER;
user.buyerUid = USER_BUYER_ID;
user.ext = new Ext();
user.ext.put("eids", Targeting.getEids());
final Geo userGeo = user.getGeo();
userGeo.lat = USER_LAT;
userGeo.lon = USER_LON;
return user;
}
use of org.prebid.mobile.rendering.models.openrtb.bidRequests.Ext 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.openrtb.bidRequests.Ext in project prebid-mobile-android by prebid.
the class NativeEventTrackerTest method whenSetExt_ExtWasSet.
@Test
public void whenSetExt_ExtWasSet() {
Ext ext = new Ext();
ext.put("test", "test");
ArrayList<NativeEventTracker.EventTrackingMethod> eventTrackingMethods = new ArrayList<>();
eventTrackingMethods.add(NativeEventTracker.EventTrackingMethod.IMAGE);
NativeEventTracker nativeEventTracker = new NativeEventTracker(NativeEventTracker.EventType.IMPRESSION, eventTrackingMethods);
nativeEventTracker.setExt(ext);
assertEquals(ext.getJsonObject().toString(), nativeEventTracker.getExt().getJsonObject().toString());
}
Aggregations