Skip to content

Commit

Permalink
Fixed prebid#3355 review:
Browse files Browse the repository at this point in the history
1.remove debug codes & comment lines.
2.add test scripts for no-formattype resp case.
  • Loading branch information
wilder0601 committed Jan 15, 2024
1 parent b6988f1 commit f2697d8
Show file tree
Hide file tree
Showing 2 changed files with 148 additions and 3 deletions.
3 changes: 0 additions & 3 deletions adapters/adview/adview.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.R
for _, seatBid := range response.SeatBid {
for i, bid := range seatBid.Bid {
bidType, err := getMediaTypeForBid(bid, request.Imp)
//bidType, err := getMediaTypeForImp(bid.ImpID, request.Imp)
if err != nil {
errors = append(errors, err)
continue
Expand Down Expand Up @@ -206,10 +205,8 @@ func getBidType(bidExt *adviewBidExt) openrtb_ext.BidType {
switch bidExt.BidType {
case 0:
bidType = openrtb_ext.BidTypeBanner
//fmt.Println("==== [adview] getBidType(): ==> banner ===")
case 1:
bidType = openrtb_ext.BidTypeVideo
//fmt.Println("==== [adview] getBidType(): ==> video ===")
case 2:
bidType = openrtb_ext.BidTypeNative
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"mockBidRequest": {
"id": "some-request-id",
"device": {
"ua": "test-user-agent",
"ip": "123.123.123.123",
"ifa":"00000000-0000-0000-0000-000000000000",
"language": "en",
"dnt": 0
},
"tmax": 1000,
"user": {
"buyeruid": "awesome-user"
},
"app": {
"publisher": {
"id": "123456789"
},
"cat": [
"IAB22-1"
],
"bundle": "com.app.awesome",
"name": "Awesome App",
"domain": "awesomeapp.com",
"id": "123456789"
},
"imp": [
{
"id": "some-impression-id",
"banner": {
"w": 320,
"h": 50
},
"ext": {
"bidder": {
"placementId": "posid00001",
"accountId": "accountid01"
}
}
}
]
},
"httpCalls": [
{
"expectedRequest": {
"uri": "https://bid.adview.com/agent/thirdAdxService/accountid01",
"body": {
"id": "some-request-id",
"cur": ["USD"],
"device": {
"ua": "test-user-agent",
"ip": "123.123.123.123",
"ifa":"00000000-0000-0000-0000-000000000000",
"language": "en",
"dnt": 0
},
"imp": [
{
"id": "some-impression-id",
"banner": {
"w": 320,
"h": 50
},
"tagid": "posid00001",
"ext": {
"bidder": {
"placementId": "posid00001",
"accountId": "accountid01"
}
}
}
],
"app": {
"id": "123456789",
"name": "Awesome App",
"bundle": "com.app.awesome",
"domain": "awesomeapp.com",
"cat": [
"IAB22-1"
],
"publisher": {
"id": "123456789"
}
},
"user": {
"buyeruid": "awesome-user"
},
"tmax": 1000
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "awesome-resp-id",
"seatbid": [
{
"bid": [
{
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "some-impression-id",
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
"awesome.com"
],
"crid": "20",
"w": 320,
"h": 50
}
],
"type": "banner",
"seat": "adview"
}
],
"cur": "USD",
"ext": {
"responsetimemillis": {
"adview": 154
},
"tmaxrequest": 1000
}
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "some-impression-id",
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
"awesome.com"
],
"crid": "20",
"w": 320,
"h": 50
},
"type": "banner"
}
]
}
]
}

0 comments on commit f2697d8

Please sign in to comment.