Skip to content

Commit

Permalink
fix bigoad updater
Browse files Browse the repository at this point in the history
  • Loading branch information
linzhucheng committed Jun 12, 2024
1 parent 74967e9 commit fccd9b7
Show file tree
Hide file tree
Showing 15 changed files with 237 additions and 43 deletions.
7 changes: 0 additions & 7 deletions adapters/bigoad/bigoad.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,6 @@ func getBidType(imp openrtb2.Imp, bid openrtb2.Bid) (openrtb_ext.BidType, error)
case openrtb2.MarkupVideo:
return openrtb_ext.BidTypeVideo, nil
}
if imp.Native != nil {
return openrtb_ext.BidTypeNative, nil
} else if imp.Banner != nil {
return openrtb_ext.BidTypeBanner, nil
} else if imp.Video != nil {
return openrtb_ext.BidTypeVideo, nil
}

return "", &errortypes.BadInput{
Message: fmt.Sprintf("unrecognized bid type in response from bigoad %s", imp.ID),
Expand Down
2 changes: 1 addition & 1 deletion adapters/bigoad/bigoad_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderBigoAd,
config.Adapter{Endpoint: "https://{{.Host}}/Ad/GetAdOut?sspid={{.SspId}}"},
config.Adapter{Endpoint: "https://api.imotech.tech/Ad/GetAdOut?sspid={{.SspId}}"},
config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
Expand Down
4 changes: 1 addition & 3 deletions adapters/bigoad/bigoadtest/exemplary/banner_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -49,7 +48,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"headers": {
"Content-Type": [
"application/json;charset=utf-8"
Expand Down Expand Up @@ -99,7 +98,6 @@
]
},
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand Down
6 changes: 3 additions & 3 deletions adapters/bigoad/bigoadtest/exemplary/banner_web.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -46,7 +45,7 @@
"2.5"
]
},
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"body": {
"id": "some-request-id",
"device": {
Expand All @@ -64,7 +63,6 @@
"h": 50
},
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand Down Expand Up @@ -92,6 +90,7 @@
{
"id": "some-impression-id1",
"impid": "some-impression-id1",
"mtype": 1,
"price": 3.5,
"adm": "test_adm",
"adomain": [
Expand All @@ -118,6 +117,7 @@
"bid": {
"id": "some-impression-id1",
"impid": "some-impression-id1",
"mtype": 1,
"price": 3.5,
"adm": "test_adm",
"crid": "20",
Expand Down
4 changes: 1 addition & 3 deletions adapters/bigoad/bigoadtest/exemplary/native_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -54,7 +53,7 @@
"2.5"
]
},
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"body": {
"id": "some-request-id",
"device": {
Expand All @@ -72,7 +71,6 @@
},
"tagid": "ogTAGID",
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand Down
6 changes: 3 additions & 3 deletions adapters/bigoad/bigoadtest/exemplary/native_web.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -48,7 +47,7 @@
"2.5"
]
},
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"body": {
"id": "some-request-id",
"device": {
Expand All @@ -66,7 +65,6 @@
"request": "{\"adunit\":2,\"assets\":[{\"id\":3,\"img\":{\"h\":120,\"hmin\":0,\"type\":3,\"w\":180,\"wmin\":0},\"required\":1},{\"id\":0,\"required\":1,\"title\":{\"len\":25}},{\"data\":{\"len\":25,\"type\":1},\"id\":4,\"required\":1},{\"data\":{\"len\":140,\"type\":2},\"id\":6,\"required\":1}],\"context\":1,\"layout\":1,\"contextsubtype\":11,\"plcmtcnt\":1,\"plcmttype\":2,\"ver\":\"1.1\",\"ext\":{\"banner\":{\"w\":320,\"h\":50}}}"
},
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand Down Expand Up @@ -96,6 +94,7 @@
{
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "some-impression-id",
"mtype": 4,
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
Expand All @@ -119,6 +118,7 @@
"bid": {
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "some-impression-id",
"mtype": 4,
"price": 3.5,
"adm": "awesome-markup",
"crid": "20",
Expand Down
4 changes: 1 addition & 3 deletions adapters/bigoad/bigoadtest/exemplary/video_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -59,7 +58,7 @@
"2.5"
]
},
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"body": {
"id": "some-request-id",
"device": {
Expand All @@ -82,7 +81,6 @@
},
"tagid": "ogTAGID",
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand Down
6 changes: 3 additions & 3 deletions adapters/bigoad/bigoadtest/exemplary/video_web.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -53,7 +52,7 @@
"2.5"
]
},
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"body": {
"id": "some-request-id",
"device": {
Expand All @@ -76,7 +75,6 @@
"h": 480
},
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand Down Expand Up @@ -106,6 +104,7 @@
{
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "some-impression-id",
"mtype": 2,
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
Expand Down Expand Up @@ -136,6 +135,7 @@
"bid": {
"id": "a3ae1b4e2fc24a4fb45540082e98e161",
"impid": "some-impression-id",
"mtype": 2,
"price": 3.5,
"adm": "awesome-markup",
"adomain": [
Expand Down
17 changes: 12 additions & 5 deletions adapters/bigoad/bigoadtest/supplemental/empty_seatbid.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
},
"ext": {
"bidder": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -59,7 +58,7 @@
"2.5"
]
},
"uri": "https://host/Ad/GetAdOut?sspid=sspid",
"uri": "https://api.imotech.tech/Ad/GetAdOut?sspid=sspid",
"body": {
"id": "some-request-id",
"device": {
Expand All @@ -82,7 +81,6 @@
},
"tagid": "ogTAGID",
"ext": {
"host": "host",
"sspid": "sspid"
}
}
Expand All @@ -109,10 +107,19 @@
]
},
"mockResponse": {
"status": 204
"status": 200,
"body": {
"id": "test-request-id",
"seatbid": []
}
}
}
],
"expectedBidResponses": [],
"expectedMakeBidsErrors": []
"expectedMakeBidsErrors": [
{
"value": "Empty SeatBid array",
"comparison": "literal"
}
]
}
Loading

0 comments on commit fccd9b7

Please sign in to comment.