diff --git a/adapters/gumgum/gumgum.go b/adapters/gumgum/gumgum.go index 9e25e291825..4e44aacb82e 100644 --- a/adapters/gumgum/gumgum.go +++ b/adapters/gumgum/gumgum.go @@ -161,12 +161,8 @@ func preprocess(imp *openrtb2.Imp) (*openrtb_ext.ExtImpGumGum, error) { } if imp.Video != nil { - err := validateVideoParams(imp.Video) - if err != nil { - return nil, err - } - if gumgumExt.IrisID != "" { + var err error videoCopy := *imp.Video videoExt := openrtb_ext.ExtImpGumGumVideo{IrisID: gumgumExt.IrisID} videoCopy.Ext, err = json.Marshal(&videoExt) @@ -221,15 +217,6 @@ func getMediaTypeForImpID(impID string, imps []openrtb2.Imp) openrtb_ext.BidType return openrtb_ext.BidTypeVideo } -func validateVideoParams(video *openrtb2.Video) (err error) { - if video.W == nil || *video.W == 0 || video.H == nil || *video.H == 0 || video.MinDuration == 0 || video.MaxDuration == 0 || video.Placement == 0 || video.Linearity == 0 { - return &errortypes.BadInput{ - Message: "Invalid or missing video field(s)", - } - } - return nil -} - // Builder builds a new instance of the GumGum adapter for the given bidder with the given config. func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) { bidder := &adapter{ diff --git a/adapters/gumgum/gumgumtest/supplemental/missing-video-params.json b/adapters/gumgum/gumgumtest/supplemental/missing-video-params.json deleted file mode 100644 index b2475cd7bb4..00000000000 --- a/adapters/gumgum/gumgumtest/supplemental/missing-video-params.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "mimes": [ - "video/mp4" - ], - "protocols": [ - 1, - 2 - ], - "w": 640, - "h": 480, - "startdelay": 1, - "placement": 1, - "linearity": 1 - }, - "ext": { - "bidder": { - "zone": "ggumtest" - } - } - } - ] - }, - "expectedMakeRequestsErrors": [ - { - "value": "Invalid or missing video field(s)", - "comparison": "literal" - } - ] - } - \ No newline at end of file diff --git a/adapters/gumgum/gumgumtest/supplemental/video-missing-size.json b/adapters/gumgum/gumgumtest/supplemental/video-missing-size.json deleted file mode 100644 index 1e4afe167ea..00000000000 --- a/adapters/gumgum/gumgumtest/supplemental/video-missing-size.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "mockBidRequest": { - "id": "test-request-id", - "imp": [ - { - "id": "test-imp-id", - "video": { - "mimes": [ - "video/mp4" - ], - "minduration": 1, - "maxduration": 2, - "protocols": [ - 1, - 2 - ], - "startdelay": 1, - "placement": 1, - "linearity": 1 - }, - "ext": { - "bidder": { - "zone": "ggumtest" - } - } - } - ] - }, - "expectedMakeRequestsErrors": [ - { - "value": "Invalid or missing video field(s)", - "comparison": "literal" - } - ] -} \ No newline at end of file diff --git a/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json b/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json index 3c9727a1a9c..ce43a93b145 100644 --- a/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json +++ b/adapters/gumgum/gumgumtest/supplemental/video-partial-size.json @@ -27,10 +27,79 @@ } ] }, - "expectedMakeRequestsErrors": [ + "httpCalls": [ { - "value": "Invalid or missing video field(s)", - "comparison": "literal" + "expectedRequest": { + "uri": "https://g2.gumgum.com/providers/prbds2s/bid", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2 + ], + "w": 640, + "startdelay": 1, + "placement": 1, + "linearity": 1 + }, + "ext": { + "bidder": { + "zone": "ggumtest" + } + } + } + ] + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "seatbid": [ + { + "bid": [ + { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + } + ] + } + ] + } + } + } +], +"expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + }, + "type": "video" + } + ] } - ] +] } \ No newline at end of file diff --git a/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json b/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json index d3d4b427120..4fc7dc3ce77 100644 --- a/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json +++ b/adapters/gumgum/gumgumtest/supplemental/video-zero-size.json @@ -28,10 +28,80 @@ } ] }, - "expectedMakeRequestsErrors": [ + "httpCalls": [ { - "value": "Invalid or missing video field(s)", - "comparison": "literal" + "expectedRequest": { + "uri": "https://g2.gumgum.com/providers/prbds2s/bid", + "body": { + "id": "test-request-id", + "imp": [ + { + "id": "test-imp-id", + "video": { + "mimes": [ + "video/mp4" + ], + "minduration": 1, + "maxduration": 2, + "protocols": [ + 1, + 2 + ], + "w": 0, + "h": 0, + "startdelay": 1, + "placement": 1, + "linearity": 1 + }, + "ext": { + "bidder": { + "zone": "ggumtest" + } + } + } + ] + }, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "seatbid": [ + { + "bid": [ + { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + } + ] + } + ] + } + } + } +], +"expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "15da721e-940a-4db6-8621-a1f93140b21b", + "impid": "video1", + "price": 15, + "adid": "59082", + "adm": "\n \n \n GumGum Video\n \n \n \n \n \n \n \n \n \n 00:00:15\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n", + "cid": "3579", + "crid": "59082" + }, + "type": "video" + } + ] } - ] +] } \ No newline at end of file