diff --git a/common/src/main/avro/openrtbapi.avpr b/common/src/main/avro/openrtbapi.avpr index 550285c..638913c 100644 --- a/common/src/main/avro/openrtbapi.avpr +++ b/common/src/main/avro/openrtbapi.avpr @@ -32,7 +32,7 @@ {"namespace": "org.openrtb.common.api", "protocol": "OpenRTBAPI", - "version": "2.1", + "version": "2.5", "types": [ {"name": "Segment", "type": "record", "fields": [ @@ -52,24 +52,64 @@ ] }, + {"name": "Regs", "type": "record", + "fields": [ + {"name": "coppa", "type": ["int", "null"]}, + {"name": "ext", "type": ["string", "null"]} + ] + }, + + {"name": "Deal", "type": "record", + "fields": [ + {"name": "id", "type": ["string", "null"]}, + {"name": "bidfloor", "type": ["float", "null"], "default": 0}, + {"name": "bidfloorcur", "type": ["string", "null"], "default": "USD"}, + {"name": "at", "type": ["int", "null"]}, + {"name": "wseat", "type": [{ "type": "array", "items": "string"},"null"] }, + {"name": "wadomain", "type": [{ "type": "array", "items": "string"},"null"] }, + {"name": "ext", "type": ["string", "null"]} + ] + }, + {"name": "Format", "type": "record", + "fields": [ + {"name": "w", "type": ["int", "null"]}, + {"name": "h", "type": ["int", "null"]}, + {"name": "wratio", "type": ["int", "null"]}, + {"name": "hratio", "type": ["int", "null"]}, + {"name": "wmin", "type": ["int", "null"]}, + {"name": "ext","type": ["string","null"]} + ] + }, + {"name": "Pmp", "type": "record", + "fields": [ + {"name": "private_auction", "type": ["int", "null"], "default": 0}, + {"name": "deals", "type": [{ "type": "array", "items": "Deal"},"null"] }, + {"name": "ext", "type": ["string", "null"]} + ] + }, + {"name": "Geo", "type": "record", "fields": [ {"name": "lat", "type": ["float", "null"]}, {"name": "lon", "type": ["float", "null"]}, + {"name": "type", "type": ["int", "null"]}, + {"name": "accuracy", "type": ["int","null"]}, + {"name": "lastfix", "type": ["int", "null"]}, + {"name": "ipservice", "type": ["int", "null"]}, {"name": "country", "type": ["string", "null"]}, {"name": "region", "type": ["string", "null"]}, {"name": "regionfips104", "type": ["string", "null"]}, {"name": "metro", "type": ["string", "null"]}, {"name": "city", "type": ["string", "null"]}, {"name": "zip", "type": ["string", "null"]}, - {"name": "type", "type": ["int", "null"]}, + {"name": "utcoffset", "type": ["int", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, {"name": "User", "type": "record", "fields": [ - {"name": "Id", "type": ["string", "null"]}, + {"name": "id", "type": ["string", "null"]}, {"name": "buyeruid", "type": ["string", "null"]}, {"name": "yob", "type": ["int", "null"]}, {"name": "gender", "type": ["string", "null"]}, @@ -83,25 +123,36 @@ {"name": "Device", "type": "record", "fields": [ - {"name": "dnt", "type": ["int", "null"]}, {"name": "ua", "type": ["string", "null"]}, - {"name": "ip", "type": ["string", "null"]}, {"name": "geo", "type": ["Geo", "null"]}, - {"name": "didsha1", "type": ["string", "null"]}, - {"name": "didmd5", "type": ["string", "null"]}, - {"name": "dpidsha1", "type": ["string", "null"]}, - {"name": "dpidmd5", "type": ["string", "null"]}, + {"name": "dnt", "type": ["int", "null"]}, + {"name": "lmt", "type": ["int", "null"]}, + {"name": "ip", "type": ["string", "null"]}, {"name": "ipv6", "type": ["string", "null"]}, - {"name": "carrier", "type": ["string", "null"]}, - {"name": "language", "type": ["string", "null"]}, + {"name": "deviceType", "type": ["int", "null"]}, {"name": "make", "type": ["string", "null"]}, {"name": "model", "type": ["string", "null"]}, {"name": "os", "type": ["string", "null"]}, - {"name": "Osv", "type": ["string", "null"]}, - {"name": "Js", "type": ["int", "null"]}, - {"name": "connectiontype", "type": ["int", "null"]}, - {"name": "deviceType", "type": ["int", "null"]}, + {"name": "osv", "type": ["string", "null"]}, + {"name": "hwv", "type": ["string", "null"]}, + {"name": "h", "type": ["int", "null"]}, + {"name": "w", "type": ["int", "null"]}, + {"name": "ppi", "type": ["int", "null"]}, + {"name": "pxratio", "type": ["float", "null"]}, + {"name": "js", "type": ["int", "null"]}, + {"name": "geofetch", "type": ["int", "null"]}, {"name": "flashver", "type": ["string", "null"]}, + {"name": "language", "type": ["string", "null"]}, + {"name": "carrier", "type": ["string", "null"]}, + {"name": "mccmnc", "type": ["string", "null"]}, + {"name": "connectiontype", "type": ["int", "null"]}, + {"name": "ifa", "type": ["string", "null"]}, + {"name": "didsha1", "type": ["string", "null"]}, + {"name": "didmd5", "type": ["string", "null"]}, + {"name": "dpidsha1", "type": ["string", "null"]}, + {"name": "dpidmd5", "type": ["string", "null"]}, + {"name": "macsha1", "type": ["string", "null"]}, + {"name": "macmd5", "type": ["string", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, @@ -133,20 +184,26 @@ {"name": "title", "type": ["string", "null"]}, {"name": "series", "type": ["string", "null"]}, {"name": "season", "type": ["string", "null"]}, + {"name": "artist", "type": ["string", "null"]}, + {"name": "genre", "type": ["string", "null"]}, + {"name": "album", "type": ["string", "null"]}, + {"name": "isrc", "type": ["string", "null"]}, + {"name": "producer", "type": ["Producer", "null"]}, {"name": "url", "type": ["string", "null"]}, {"name": "cat", "type": [{ "type": "array", "items": "string"},"null"] }, + {"name": "prodq", "type": ["int", "null"]}, {"name": "videoquality", "type": ["int", "null"]}, - {"name": "keywords", "type": ["string", "null"]}, + {"name": "context", "type": ["string", "null"]}, {"name": "contentrating", "type": ["string", "null"]}, {"name": "userrating", "type": ["string", "null"]}, - {"name": "context", "type": ["string", "null"]}, + {"name": "qagmediarating", "type": ["int", "null"]}, + {"name": "keywords", "type": ["string", "null"]}, {"name": "livestream", "type": ["int", "null"]}, {"name": "sourcerelationship", "type": ["int", "null"]}, - {"name": "producer", "type": ["Producer", "null"]}, {"name": "len", "type": ["int", "null"]}, - {"name": "qagmediarating", "type": ["int", "null"]}, - {"name": "embeddable", "type": ["int", "null"]}, {"name": "language", "type": ["string", "null"]}, + {"name": "embeddable", "type": ["int", "null"]}, + {"name": "data","type": [{"type": "array","items": "Data"},"null"]}, {"name": "ext", "type": ["string", "null"]} ] }, @@ -155,18 +212,18 @@ "fields": [ {"name": "id", "type": ["string", "null"]}, {"name": "name", "type": ["string", "null"]}, + {"name": "bundle", "type": ["string", "null"]}, {"name": "domain", "type": ["string", "null"]}, + {"name": "storeurl", "type": ["string", "null"]}, {"name": "cat", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "sectioncat", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "pagecat", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "ver", "type": ["string", "null"]}, - {"name": "bundle", "type": ["string", "null"]}, {"name": "privacypolicy", "type": ["int", "null"]}, {"name": "paid", "type": ["int", "null"]}, {"name": "publisher", "type": ["Publisher", "null"]}, {"name": "content", "type": ["Content", "null"]}, {"name": "keywords", "type": ["string", "null"]}, - {"name": "storeurl", "type": ["string", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, @@ -180,9 +237,10 @@ {"name": "sectioncat", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "pagecat", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "page", "type": ["string", "null"]}, - {"name": "privacypolicy", "type": ["int", "null"]}, {"name": "ref", "type": ["string", "null"]}, {"name": "search", "type": ["int", "null"]}, + {"name": "mobile", "type": ["int", "null"]}, + {"name": "privacypolicy", "type": ["int", "null"]}, {"name": "publisher", "type": ["Publisher", "null"]}, {"name": "content", "type": ["Content", "null"]}, {"name": "keywords", "type": ["string", "null"]}, @@ -192,37 +250,49 @@ {"name": "Banner", "type": "record", "fields": [ + {"name": "format","type": [{"type": "array","items": "Format"},"null"]}, {"name": "w", "type": ["int", "null"]}, {"name": "h", "type": ["int", "null"]}, - {"name": "id", "type": ["string", "null"]}, - {"name": "pos", "type": ["int", "null"]}, + {"name": "wmax", "type": ["int", "null"]}, + {"name": "hmax", "type": ["int", "null"]}, + {"name": "wmin", "type": ["int", "null"]}, + {"name": "hmin", "type": ["int", "null"]}, {"name": "btype", "type": [{ "type": "array", "items": "int"},"null"] }, {"name": "battr", "type": [{ "type": "array", "items": "int"},"null"] }, + {"name": "pos", "type": ["int", "null"]}, {"name": "mimes", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "topframe", "type": ["int", "null"]}, {"name": "expdir", "type": [{ "type": "array", "items": "int"},"null"] }, {"name": "api", "type":[{ "type": "array", "items": "int"},"null"] }, + {"name": "id", "type": ["string", "null"]}, + {"name": "vcm", "type": ["int", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, - + {"name": "Video", "type": "record", "fields": [ {"name": "mimes", "type": { "type": "array", "items": "string"} }, - {"name": "linearity", "type": ["int", "null"]}, {"name": "minduration", "type": ["int", "null"]}, {"name": "maxduration", "type": ["int", "null"]}, {"name": "protocol", "type": ["int", "null"]}, + {"name": "protocols", "type": [{ "type": "array", "items": "int"}, "null"] }, {"name": "w", "type": ["int", "null"]}, {"name": "h", "type": ["int", "null"]}, {"name": "startdelay", "type": ["int", "null"]}, + {"name": "placement", "type": ["int", "null"]}, + {"name": "linearity", "type": ["int", "null"]}, + {"name": "skip", "type": ["int", "null"]}, + {"name": "skipmin", "type": ["int", "null"], "default": 0}, + {"name": "skipafter", "type": ["int", "null"], "default": 0}, {"name": "sequence", "type": ["int", "null"]}, {"name": "battr", "type": [{ "type": "array", "items": "int"},"null"]}, {"name": "maxextended", "type": ["int", "null"]}, {"name": "minbitrate", "type": ["int", "null"]}, {"name": "maxbitrate", "type": ["int", "null"]}, - {"name": "boxingallowed", "type": ["int", "null"]}, + {"name": "boxingallowed", "type": ["int", "null"], "default": 1}, {"name": "playbackmethod", "type": [{ "type": "array", "items": "int"},"null"] }, + {"name": "playbackend", "type": ["int", "null"]}, {"name": "delivery", "type": [{ "type": "array", "items": "int"},"null"] }, {"name": "pos", "type": ["int", "null"]}, {"name": "companionad", "type": [{ "type": "array", "items": "Banner"},"null"] }, @@ -231,19 +301,78 @@ {"name": "ext", "type": ["string", "null"]} ] }, - - {"name": "Impression", "type": "record", + { "name": "Audio", "type": "record", + "fields": [ + { "name": "mimes", "type": { "type": "array", "items": "string" } }, + { "name": "minduration", "type": [ "int", "null" ] }, + { "name": "maxduration", "type": [ "int", "null" ] }, + { "name": "protocols", "type": [ { "type": "array", "items": "int" }, "null" ] }, + { "name": "startdelay", "type": [ "int", "null" ] }, + { "name": "sequence", "type": [ "int", "null" ] }, + { "name": "battr", "type": [ { "type": "array", "items": "int" }, "null" ] }, + { "name": "maxextended", "type": [ "int", "null" ] }, + { "name": "minbitrate", "type": [ "int", "null" ] }, + { "name": "maxbitrate", "type": [ "int", "null" ] }, + { "name": "delivery", "type": [ { "type": "array", "items": "int" }, "null" ] }, + { "name": "companionad", "type": [ { "type": "array", "items": "Banner" }, "null" ] }, + { "name": "api", "type": [ { "type": "array", "items": "int" }, "null" ] }, + { "name": "companiontype", "type": [ { "type": "array", "items": "int" }, "null" ] }, + { "name": "maxseq", "type": [ "int", "null" ] }, + { "name": "feed", "type": [ "int", "null" ] }, + { "name": "stiched", "type": [ "int", "null" ] }, + { "name": "nvol", "type": [ "int", "null" ] }, + { "name": "ext", "type": [ "string", "null" ] } + ] + }, + { + "name": "Source", + "type": "record", + "fields": [ + {"name": "fd","type": ["int","null"]}, + {"name": "tid","type": ["string","null"]}, + {"name": "pchain","type": ["string","null"]}, + {"name": "ext","type": ["string","null"]} + ] + }, + { + "name": "Metric", + "type": "record", + "fields": [ + {"name": "type","type": ["string","null"]}, + {"name": "value","type": ["float","null"]}, + {"name": "vendor","type": ["string","null"]}, + {"name": "ext","type": ["string","null"]} + ] + }, + {"name": "Native", "type": "record", + "fields": [ + {"name": "request", "type": ["string", "null"] }, + {"name": "ver", "type": ["string", "null"] }, + {"name": "api", "type": [{ "type": "array", "items": "int"}, "null"] }, + {"name": "battr", "type": [{ "type": "array", "items": "int"}, "null"] }, + {"name": "ext", "type": ["string", "null"] } + ] + }, + + {"name": "Imp", "type": "record", "fields": [ {"name": "id", "type": ["string", "null"]}, + {"name": "metric", "type": [{ "type": "array", "items": "Metric"},"null"] }, {"name": "banner", "type": ["Banner", "null"]}, {"name": "video", "type": ["Video", "null"]}, + {"name": "audio","type": ["Audio","null"]}, + {"name": "native", "type": ["Native", "null"]}, + {"name": "pmp", "type": ["Pmp", "null"]}, {"name": "displaymanager", "type": ["string", "null"]}, {"name": "displaymanagerver", "type": ["string", "null"]}, - {"name": "instl", "type": ["int", "null"]}, + {"name": "instl", "type": ["int", "null"], "default": 0}, {"name": "tagid", "type": ["string", "null"]}, - {"name": "bidfloor", "type": ["float", "null"]}, - {"name": "bidfloorcur", "type": ["string", "null"]}, + {"name": "bidfloor", "type": ["float", "null"], "default": 0}, + {"name": "bidfloorcur", "type": ["string", "null"], "default": "USD"}, + {"name": "clickbrowser", "type": ["int", "null"]}, + {"name": "secure", "type": ["int", "null"]}, {"name": "iframebuster", "type": [{ "type": "array", "items": "string"},"null"] }, + {"name": "exp", "type": ["int", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, @@ -251,18 +380,24 @@ {"name": "BidRequest", "type": "record", "fields": [ {"name": "id", "type": ["string", "null"]}, - {"name": "imp", "type": { "type": "array", "items": "Impression"} }, + {"name": "imp", "type": [{ "type": "array", "items": "Imp"},"null"] }, {"name": "site", "type": ["Site", "null"]}, {"name": "app", "type": ["App", "null"]}, {"name": "device", "type": ["Device", "null"]}, {"name": "user", "type": ["User", "null"]}, - {"name": "at", "type": ["int", "null"]}, + {"name": "test", "type": ["int", "null"], "default": 0}, + {"name": "at", "type": ["int", "null"], "default": 2}, {"name": "tmax", "type": ["int", "null"]}, {"name": "wseat", "type": [{ "type": "array", "items": "string"},"null"] }, - {"name": "allimps", "type": ["int", "null"]}, + {"name": "bseat", "type": [{ "type": "array", "items": "string"},"null"] }, + {"name": "allimps", "type": ["int", "null"], "default": 0}, {"name": "cur", "type": [{ "type": "array", "items": "string"},"null"]}, - {"name": "bcat", "type": [{ "type": "array", "items":"string"},"null"]}, + {"name": "wlang", "type": [{ "type": "array", "items": "string"},"null"]}, + {"name": "bcat", "type": [{ "type": "array", "items":"string"},"null"]}, {"name": "badv", "type": [{ "type": "array", "items":"string"},"null"]}, + {"name": "bapp", "type": [{ "type": "array", "items":"string"},"null"]}, + {"name": "source","type": ["Source","null"]}, + {"name": "regs", "type": ["Regs", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, @@ -272,23 +407,38 @@ {"name": "id", "type": ["string", "null"]}, {"name": "impid", "type": ["string", "null"]}, {"name": "price", "type": ["float", "null"]}, - {"name": "adid", "type": ["string", "null"]}, {"name": "nurl", "type": ["string", "null"]}, + {"name": "burl", "type": ["string", "null"]}, + {"name": "lurl", "type": ["string", "null"]}, {"name": "adm", "type": ["string", "null"]}, + {"name": "adid", "type": ["string", "null"]}, {"name": "adomain", "type": [{ "type": "array", "items": "string"},"null"] }, + {"name": "bundle", "type": ["string", "null"]}, {"name": "iurl", "type": ["string", "null"]}, {"name": "cid", "type": ["string", "null"]}, {"name": "crid", "type": ["string", "null"]}, + {"name": "tactic", "type": ["string", "null"]}, + {"name": "cat", "type": [{ "type": "array", "items": "string"},"null"] }, {"name": "attr", "type": [{ "type": "array", "items": "int"},"null"] }, + {"name": "api", "type": ["int", "null"]}, + {"name": "protocol", "type": ["int", "null"]}, + {"name": "quagmediarating", "type": ["int", "null"]}, + {"name": "language", "type": ["string", "null"]}, + {"name": "dealid", "type": ["string", "null"]}, + {"name": "w", "type": ["int", "null"]}, + {"name": "h", "type": ["int", "null"]}, + {"name": "wratio", "type": ["int", "null"]}, + {"name": "hratio", "type": ["int", "null"]}, + {"name": "exp", "type": ["int", "null"]}, {"name": "ext", "type": ["string", "null"]} ] }, - + {"name": "SeatBid", "type": "record", "fields": [ {"name": "bid", "type": { "type": "array", "items": "Bid"} }, {"name": "seat", "type": ["string", "null"]}, - {"name": "group", "type": ["string", "null"]}, + {"name": "group", "type": ["int", "null"], "default":0}, {"name": "ext", "type": ["string", "null"]} ] }, @@ -298,8 +448,9 @@ {"name": "id", "type": ["string", "null"]}, {"name": "seatbid", "type": { "type": "array", "items": "SeatBid"} }, {"name": "bidid", "type": ["string", "null"]}, - {"name": "cur", "type": ["string", "null"]}, + {"name": "cur", "type": ["string", "null"], "default": "USD"}, {"name": "customdata", "type": ["string", "null"]}, + {"name": "nbr", "type": ["int", "null"]}, {"name": "ext", "type": ["string", "null"]} ] } diff --git a/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/SimpleBidder.java b/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/SimpleBidder.java index 62229ed..6354aac 100644 --- a/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/SimpleBidder.java +++ b/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/SimpleBidder.java @@ -65,7 +65,7 @@ public BidResponse process(BidRequest request) throws AvroRemoteException response.id = wReq.getId(); response.bidid = "simple-bid-tracker"; Map seats = wReq.getUnblockedSeats(wReq.getSSPName()); - for (Impression i : wReq.getRequest().getImp()) + for (Imp i : wReq.getRequest().getImp()) { for (Map.Entry s : seats.entrySet()) { @@ -104,10 +104,10 @@ public boolean validateRequest(BidRequest request) { logger.error("BidRequest must have one or more impressions"); return false; } else { - List impressionList = request.getImp(); - Iterator itr = impressionList.iterator(); + List impressionList = request.getImp(); + Iterator itr = impressionList.iterator(); while (itr.hasNext()) { - Impression imp = itr.next(); + Imp imp = itr.next(); if (imp.getId() == null) { logger.error("Impression must have valid Id"); return false; diff --git a/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/StatefulBidder.java b/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/StatefulBidder.java index f3fae2b..3e21209 100644 --- a/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/StatefulBidder.java +++ b/demand-side/dsp-client/src/main/java/org/openrtb/dsp/client/StatefulBidder.java @@ -45,7 +45,7 @@ import org.openrtb.common.api.Bid; import org.openrtb.common.api.BidRequest; import org.openrtb.common.api.BidResponse; -import org.openrtb.common.api.Impression; +import org.openrtb.common.api.Imp; import org.openrtb.common.api.OpenRTBAPI; import org.openrtb.common.api.SeatBid; import org.openrtb.common.util.StringUtils; @@ -94,12 +94,12 @@ public boolean validateRequest(BidRequest request) { logger.error("BidRequest must have one or more impressions"); return false; } else { - List impressionList = request.getImp(); - Iterator itr = impressionList.iterator(); + List impressionList = request.getImp(); + Iterator itr = impressionList.iterator(); while (itr.hasNext()) { - Impression imp = itr.next(); + Imp imp = itr.next(); if (imp.getId() == null) { - logger.error("Impression must have valid Id"); + logger.error("Imp must have valid Id"); return false; } else if (imp.getBanner() == null && imp.getVideo() == null) { logger.error("Impression must have atleast Banner or Video Object"); @@ -135,7 +135,7 @@ public BidResponse selectBids(RTBRequestWrapper wReq, BidResponse response) { Map seats = wReq.getUnblockedSeats(wReq .getSSPName()); - for (Impression i : wReq.getRequest().getImp()) { + for (Imp i : wReq.getRequest().getImp()) { for (Map.Entry s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); diff --git a/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/FiniteStateMachineTest.java b/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/FiniteStateMachineTest.java index f5d36da..801def7 100644 --- a/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/FiniteStateMachineTest.java +++ b/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/FiniteStateMachineTest.java @@ -16,7 +16,7 @@ import org.openrtb.common.api.Banner; import org.openrtb.common.api.BidRequest; import org.openrtb.common.api.BidResponse; -import org.openrtb.common.api.Impression; +import org.openrtb.common.api.Imp; import org.openrtb.common.api.Site; import org.openrtb.common.api.Video; import org.openrtb.dsp.intf.model.RTBAdvertiser; @@ -38,7 +38,7 @@ public void setUpFormatError() { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor(new Float(10.085)); @@ -55,7 +55,7 @@ public void setUpFormatError() { site.setId("124545sfdghs"); when(requestError.getImp()).thenReturn( - Collections. singletonList(imp)); + Collections. singletonList(imp)); when(requestError.getSite()).thenReturn(site); when(requestError.getWseat()).thenReturn( Collections. singletonList("012asfdfd25")); @@ -67,7 +67,7 @@ public void setUpNoMatchingBid() { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor(new Float(10.085)); @@ -94,7 +94,7 @@ public void setUpRequestExpired() { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor(new Float(10.085)); @@ -107,7 +107,7 @@ public void setUpRequestExpired() { video.setMaxduration(500); video.setProtocol(200); imp.setVideo(video); - List impList = new ArrayList(); + List impList = new ArrayList(); for (int i = 0; i < 1000000; i++) { imp.setId("10212sdsa1" + i); impList.add(imp); @@ -127,7 +127,7 @@ public void setUpOfferedExpired() { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor(new Float(10.085)); @@ -140,7 +140,7 @@ public void setUpOfferedExpired() { video.setMaxduration(500); video.setProtocol(200); imp.setVideo(video); - List impList = new ArrayList(); + List impList = new ArrayList(); for (int i = 0; i < 10; i++) { imp.setId("10212sdsa1" + i); impList.add(imp); diff --git a/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/SimpleBidderTest.java b/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/SimpleBidderTest.java index 8d8de96..11c9049 100644 --- a/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/SimpleBidderTest.java +++ b/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/SimpleBidderTest.java @@ -20,7 +20,7 @@ import org.openrtb.common.api.Banner; import org.openrtb.common.api.BidRequest; import org.openrtb.common.api.BidResponse; -import org.openrtb.common.api.Impression; +import org.openrtb.common.api.Imp; import org.openrtb.common.api.Site; import org.openrtb.common.api.Video; import org.openrtb.dsp.intf.model.DSPException; @@ -46,7 +46,7 @@ public void setUp() throws Exception { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor((float) 10.085); @@ -65,7 +65,7 @@ public void setUp() throws Exception { when(request.getId()).thenReturn( "ad1d762d6d9719b6b3c9e09f6433a76d9b593738"); when(request.getImp()).thenReturn( - Collections. singletonList(imp)); + Collections. singletonList(imp)); when(request.getApp()).thenReturn(app); when(request.getWseat()).thenReturn( Collections. singletonList("012asfdfd25")); @@ -78,7 +78,7 @@ public void setUpSiteTest() throws Exception { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor((float) 10.085); @@ -97,7 +97,7 @@ public void setUpSiteTest() throws Exception { when(requestSite.getId()).thenReturn( "ad1d762d6d9719b6b3c9e09f6433a76d9b593738"); when(requestSite.getImp()).thenReturn( - Collections. singletonList(imp)); + Collections. singletonList(imp)); when(requestSite.getWseat()).thenReturn( Collections. singletonList("012asfdfd25")); when(requestSite.getSite()).thenReturn(site); @@ -129,10 +129,10 @@ public void appTest() { */ @Test public void bannerAdTest() { - List impList = request.getImp(); - Iterator itr = impList.iterator(); + List impList = request.getImp(); + Iterator itr = impList.iterator(); while (itr.hasNext()) { - Impression imp = itr.next(); + Imp imp = itr.next(); Banner b = imp.getBanner(); assertTrue("Height of the impression must be provided in Banner Object", b.getH() == 25); @@ -160,10 +160,10 @@ public void SiteTest() { */ @Test public void videoAdTest() { - List impList = request.getImp(); - Iterator itr = impList.iterator(); + List impList = request.getImp(); + Iterator itr = impList.iterator(); while (itr.hasNext()) { - Impression imp = itr.next(); + Imp imp = itr.next(); Video video = imp.getVideo(); assertNotNull("mimes types must be provided in Video Object", video.getMimes()); diff --git a/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/StatefulBidderTest.java b/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/StatefulBidderTest.java index 24fae30..207c87f 100644 --- a/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/StatefulBidderTest.java +++ b/demand-side/dsp-client/src/test/java/org/openrtb/dsp/client/StatefulBidderTest.java @@ -19,7 +19,7 @@ import org.openrtb.common.api.Banner; import org.openrtb.common.api.BidRequest; import org.openrtb.common.api.BidResponse; -import org.openrtb.common.api.Impression; +import org.openrtb.common.api.Imp; import org.openrtb.common.api.Site; import org.openrtb.common.api.Video; import org.openrtb.dsp.intf.model.DSPException; @@ -43,7 +43,7 @@ public void setUp() { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor(new Float(10.085) ); @@ -62,7 +62,7 @@ public void setUp() { when(request.getId()).thenReturn( "ad1d762d6d9719b6b3c9e09f6433a76d9b593738"); when(request.getImp()).thenReturn( - Collections. singletonList(imp)); + Collections. singletonList(imp)); when(request.getApp()).thenReturn(app); when(request.getWseat()).thenReturn( Collections. singletonList("012asfdfd25")); @@ -75,7 +75,7 @@ public void setUpSiteTest() { Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor(new Float(10.085) ); @@ -94,7 +94,7 @@ public void setUpSiteTest() { when(requestSite.getId()).thenReturn( "ad1d762d6d9719b6b3c9e09f6433a76d9b593738"); when(requestSite.getImp()).thenReturn( - Collections. singletonList(imp)); + Collections. singletonList(imp)); when(requestSite.getSite()).thenReturn(site); when(requestSite.getWseat()).thenReturn( Collections. singletonList("012asfdfd25")); @@ -125,10 +125,10 @@ public void appTest() { */ @Test public void bannerAdTest() { - List impList = request.getImp(); - Iterator itr = impList.iterator(); + List impList = request.getImp(); + Iterator itr = impList.iterator(); while (itr.hasNext()) { - Impression imp = itr.next(); + Imp imp = itr.next(); Banner b = imp.getBanner(); assertTrue("Height of the impression must be provided in Banner Object", b.getH() == 25); @@ -142,10 +142,10 @@ public void bannerAdTest() { */ @Test public void videoAdTest() { - List impList = request.getImp(); - Iterator itr = impList.iterator(); + List impList = request.getImp(); + Iterator itr = impList.iterator(); while (itr.hasNext()) { - Impression imp = itr.next(); + Imp imp = itr.next(); Video video = imp.getVideo(); assertNotNull("mimes types must be provided in Video Object", video.getMimes()); diff --git a/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/DemandSideServerTest.java b/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/DemandSideServerTest.java index 128f4e9..7929959 100644 --- a/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/DemandSideServerTest.java +++ b/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/DemandSideServerTest.java @@ -26,7 +26,7 @@ import org.openrtb.common.api.Data; import org.openrtb.common.api.Device; import org.openrtb.common.api.Geo; -import org.openrtb.common.api.Impression; +import org.openrtb.common.api.Imp; import org.openrtb.common.api.Site; import org.openrtb.common.api.User; import org.openrtb.common.api.Video; @@ -87,7 +87,7 @@ public void setUp() { video.setMaxextended(44); video.setMinbitrate(55); video.setMaxbitrate(55); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setVideo(video); @@ -99,7 +99,7 @@ public void setUp() { imp.setDisplaymanagerver("ss223"); imp.setTagid("56666"); imp.setBidfloorcur("dfsd"); - List impression = new ArrayList(); + List impression = new ArrayList(); impression.add(imp); List wseat = new ArrayList(); wseat.add("SeatID001"); @@ -176,14 +176,14 @@ public void setUpRequiredFieldBidRequest() { User user = new User(); user.setBuyeruid("a44"); user.setId("56sdf"); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setVideo(video); imp.setDisplaymanager("sdf555"); imp.setDisplaymanagerver("ss223"); imp.setBidfloor(new Float(15.4)); - List impression = new ArrayList(); + List impression = new ArrayList(); impression.add(imp); bidRequest.setId("102335assd55d"); diff --git a/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/OpenRTBAPIDummyTest.java b/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/OpenRTBAPIDummyTest.java index 85c1af1..1fc3e1f 100644 --- a/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/OpenRTBAPIDummyTest.java +++ b/demand-side/dsp-core/src/test/java/org/openrtb/dsp/core/OpenRTBAPIDummyTest.java @@ -63,7 +63,7 @@ public BidResponse process(BidRequest request) throws AvroRemoteException { response.bidid = "simple-bid-tracker"; Map seats = wReq.getUnblockedSeats(wReq .getSSPName()); - for (Impression i : wReq.getRequest().getImp()) { + for (Imp i : wReq.getRequest().getImp()) { for (Map.Entry s : seats.entrySet()) { RTBAdvertiser a = wReq.getAdvertiser(s.getValue()); diff --git a/demand-side/dsp-intf/src/main/java/org/openrtb/dsp/intf/model/RTBRequestWrapper.java b/demand-side/dsp-intf/src/main/java/org/openrtb/dsp/intf/model/RTBRequestWrapper.java index 4c357d1..bb991ba 100644 --- a/demand-side/dsp-intf/src/main/java/org/openrtb/dsp/intf/model/RTBRequestWrapper.java +++ b/demand-side/dsp-intf/src/main/java/org/openrtb/dsp/intf/model/RTBRequestWrapper.java @@ -32,11 +32,11 @@ package org.openrtb.dsp.intf.model; +import org.openrtb.common.api.BidRequest; + import java.util.HashMap; import java.util.Map; -import org.openrtb.common.api.BidRequest; - public class RTBRequestWrapper extends BidRequest { public RTBRequestWrapper() { @@ -52,12 +52,12 @@ public RTBRequestWrapper() { public RTBRequestWrapper(BidRequest request) { - super(request.getId(), request.getImp(), request.getSite(), request - .getApp(), request.getDevice(), request.getUser(), request - .getAt(), request.getTmax(), request.getWseat(), request - .getAllimps(), request.getCur(), request.getBcat(), request - .getBadv(), request.getExt()); - this.request = request; + super(request.getId(), request.getImp(), request.getSite(), request + .getApp(), request.getDevice(), request.getUser(), request.getTest(), request + .getAt(), request.getTmax(), request.getWseat(), request.getBseat(), request + .getAllimps(), request.getCur(), request.getWlang(), request.getBcat(), request + .getBadv(), request.getBapp(), request.getSource(), request.getRegs(), request.getExt()); + this.request = request; } public void setContext(RTBExchange exchange, Map advertisers, diff --git a/demand-side/dsp-intf/src/test/java/org/openrtb/dsp/intf/model/RTBRequestWrapperTest.java b/demand-side/dsp-intf/src/test/java/org/openrtb/dsp/intf/model/RTBRequestWrapperTest.java index 9796277..ee91328 100644 --- a/demand-side/dsp-intf/src/test/java/org/openrtb/dsp/intf/model/RTBRequestWrapperTest.java +++ b/demand-side/dsp-intf/src/test/java/org/openrtb/dsp/intf/model/RTBRequestWrapperTest.java @@ -14,11 +14,8 @@ import org.junit.Before; import org.junit.Test; -import org.openrtb.common.api.App; -import org.openrtb.common.api.Banner; -import org.openrtb.common.api.BidRequest; -import org.openrtb.common.api.Impression; -import org.openrtb.common.api.Video; +import org.openrtb.common.api.*; + /** * This class is used to test the functionality of RTBRequestWrapper class */ @@ -53,7 +50,7 @@ public void setUpBidRequest() Banner banner = new Banner(); banner.setH(25); banner.setW(30); - Impression imp = new Impression(); + Imp imp = new Imp(); imp.setId("10212sdsa1"); imp.setBanner(banner); imp.setBidfloor((float) 10.085); @@ -72,7 +69,7 @@ public void setUpBidRequest() when(bidRequest.getId()).thenReturn( "ad1d762d6d9719b6b3c9e09f6433a76d9b593738"); when(bidRequest.getImp()).thenReturn( - Collections. singletonList(imp)); + Collections. singletonList(imp)); when(bidRequest.getApp()).thenReturn(app); when(bidRequest.getWseat()).thenReturn( Collections. singletonList("012asfdfd25"));