Skip to content

Commit

Permalink
Generalize names of some test entities (#2908)
Browse files Browse the repository at this point in the history
  • Loading branch information
Net-burst authored Jan 17, 2024
1 parent ed7da8c commit e619815
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ enum TargetingType {
SITE_PUBLISHER_DOMAIN("site.publisher.domain"),
REFERRER("site.referrer"),
APP_BUNDLE("app.bundle"),
DEVICE_COUNTRY("device.geo.ext.netacuity.country"),
DEVICE_TYPE("device.ext.deviceatlas.type"),
DEVICE_OS("device.ext.deviceatlas.osfamily"),
DEVICE_REGION("device.geo.ext.netacuity.region"),
DEVICE_METRO("device.geo.ext.netacuity.metro"),
DEVICE_COUNTRY("device.geo.ext.geoprovider.country"),
DEVICE_TYPE("device.ext.deviceinfoprovider.type"),
DEVICE_OS("device.ext.deviceinfoprovider.osfamily"),
DEVICE_REGION("device.geo.ext.geoprovider.region"),
DEVICE_METRO("device.geo.ext.geoprovider.metro"),
PAGE_POSITION("pos"),
LOCATION("geo.distance"),
BIDP("bidp."),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import groovy.transform.ToString
@ToString(includeNames = true, ignoreNulls = true)
class GeoExt {

@JsonProperty("netacuity")
GeoExtNetAcuity netAcuity
@JsonProperty("geoprovider")
GeoExtGeoProvider geoProvider
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.prebid.server.functional.model.request.auction

class GeoExtNetAcuity {
class GeoExtGeoProvider {

String country
Object region
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.prebid.server.functional.model.request.auction.Bidder
import org.prebid.server.functional.model.request.auction.Device
import org.prebid.server.functional.model.request.auction.Geo
import org.prebid.server.functional.model.request.auction.GeoExt
import org.prebid.server.functional.model.request.auction.GeoExtNetAcuity
import org.prebid.server.functional.model.request.auction.GeoExtGeoProvider
import org.prebid.server.functional.model.request.auction.Imp
import org.prebid.server.functional.model.request.auction.ImpExt
import org.prebid.server.functional.model.request.auction.ImpExtContext
Expand Down Expand Up @@ -432,7 +432,7 @@ class TargetingSpec extends BasePgSpec {
def "PBS should support line item targeting by device geo region, metro when request region, metro as int or str value are given"() {
given: "Bid request"
def bidRequest = BidRequest.defaultBidRequest.tap {
device = new Device(geo: new Geo(ext: new GeoExt(netAcuity: new GeoExtNetAcuity(region: requestValue,
device = new Device(geo: new Geo(ext: new GeoExt(geoProvider: new GeoExtGeoProvider(region: requestValue,
metro: requestValue))))
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -716,9 +716,9 @@ public void matchesTargetingShouldReturnTrueForDeviceExt() throws IOException {
jsonFrom("targeting/test-device-targeting.json"), "lineItemId");

final ExtGeo extGeo = ExtGeo.of();
extGeo.addProperty("netacuity", mapper.createObjectNode().set("country", new TextNode("us")));
extGeo.addProperty("geoprovider", mapper.createObjectNode().set("country", new TextNode("us")));
final ExtDevice extDevice = ExtDevice.empty();
extDevice.addProperty("deviceatlas", mapper.createObjectNode().set("browser", new TextNode("Chrome")));
extDevice.addProperty("deviceinfoprovider", mapper.createObjectNode().set("browser", new TextNode("Chrome")));
final BidRequest bidRequest = BidRequest.builder()
.device(Device
.builder()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
{
"$and": [
{
"device.ext.deviceatlas.browser": {
"device.ext.deviceinfoprovider.browser": {
"$in": [
"Chrome",
"Firefox"
]
}
},
{
"device.geo.ext.netacuity.country": {
"device.geo.ext.geoprovider.country": {
"$in": [
"us",
"jp"
]
}
}
]
}
}

0 comments on commit e619815

Please sign in to comment.