use of org.prebid.mobile.rendering.networking.parameters.AdRequestInput in project prebid-mobile-android by prebid.
the class BidUrlComponentsTest method whenGetQueryArgString_ReturnBidRequestJson.
@Test
public void whenGetQueryArgString_ReturnBidRequestJson() throws JSONException {
AdRequestInput adRequestInput = new AdRequestInput();
BidRequest mockBidRequest = mock(BidRequest.class);
JSONObject jsonObject = new JSONObject();
jsonObject.put("test", "test");
when(mockBidRequest.getJsonObject()).thenReturn(jsonObject);
adRequestInput.setBidRequest(mockBidRequest);
BidUrlComponents bidUrlComponents = new BidUrlComponents("", adRequestInput);
assertEquals(jsonObject.toString(), bidUrlComponents.getQueryArgString());
}
use of org.prebid.mobile.rendering.networking.parameters.AdRequestInput in project prebid-mobile-android by prebid.
the class URLBuilderTest method testBuildURLObject.
@Test
public void testBuildURLObject() {
URLPathBuilder mockPathBuilder = mock(URLPathBuilder.class);
ArrayList<ParameterBuilder> parameterBuilders = new ArrayList<>();
URLBuilder urlBuilder = new URLBuilder(mockPathBuilder, parameterBuilders, new AdRequestInput());
assertNotNull(urlBuilder);
}
use of org.prebid.mobile.rendering.networking.parameters.AdRequestInput 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.networking.parameters.AdRequestInput in project prebid-mobile-android by prebid.
the class AutoDetectedOpenRtbTest method overwrittenDeviceInfoParameterBuilder.
@Test
public void overwrittenDeviceInfoParameterBuilder() {
mOriginalOpenRtbParams.getDevice().dpidmd5 = "foo";
mOriginalOpenRtbParams.getDevice().dpidsha1 = "foo";
mOriginalOpenRtbParams.getDevice().w = 0;
mOriginalOpenRtbParams.getDevice().h = 0;
mParamBuilderArray.add(new DeviceInfoParameterBuilder(new AdConfiguration()));
AdRequestInput newAdRequestInput = URLBuilder.buildParameters(mParamBuilderArray, mOriginalAdRequestInput);
BidRequest newOpenRtbParams = newAdRequestInput.getBidRequest();
assertNotEquals(mOriginalOpenRtbParams.getDevice().dpidmd5, newOpenRtbParams.getDevice().dpidmd5);
assertNotEquals(mOriginalOpenRtbParams.getDevice().dpidsha1, newOpenRtbParams.getDevice().dpidsha1);
assertNotEquals(mOriginalOpenRtbParams.getDevice().w, newOpenRtbParams.getDevice().w);
assertNotEquals(mOriginalOpenRtbParams.getDevice().h, newOpenRtbParams.getDevice().h);
}
use of org.prebid.mobile.rendering.networking.parameters.AdRequestInput 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);
}
Aggregations