diff --git a/adapters/freewheelssp/freewheelssp.go b/adapters/freewheelssp/freewheelssp.go index e80cab18748..df6f756bb65 100644 --- a/adapters/freewheelssp/freewheelssp.go +++ b/adapters/freewheelssp/freewheelssp.go @@ -13,7 +13,7 @@ import ( ) type adapter struct { - Endpoint string + endpoint string } func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) { @@ -53,7 +53,7 @@ func (a *adapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.E requestData := &adapters.RequestData{ Method: "POST", - Uri: a.Endpoint, + Uri: a.endpoint, Body: requestJSON, Headers: headers, ImpIDs: openrtb_ext.GetImpIDs(request.Imp), diff --git a/adapters/freewheelssp/freewheelssp_test.go b/adapters/freewheelssp/freewheelssp_test.go index 2bf359372b1..ea1b5b7c980 100644 --- a/adapters/freewheelssp/freewheelssp_test.go +++ b/adapters/freewheelssp/freewheelssp_test.go @@ -1,15 +1,11 @@ package freewheelssp import ( - "github.com/prebid/prebid-server/v2/adapters" - "net/http" "testing" - "github.com/prebid/openrtb/v20/openrtb2" "github.com/prebid/prebid-server/v2/adapters/adapterstest" "github.com/prebid/prebid-server/v2/config" "github.com/prebid/prebid-server/v2/openrtb_ext" - "github.com/stretchr/testify/assert" ) func TestJsonSamples(t *testing.T) { @@ -22,79 +18,3 @@ func TestJsonSamples(t *testing.T) { adapterstest.RunJSONBidderTest(t, "freewheelssptest", bidder) } - -func TestFreewheelAdapter_MakeBids(t *testing.T) { - type fields struct { - URI string - } - type args struct { - internalRequest *openrtb2.BidRequest - externalRequest *adapters.RequestData - response *adapters.ResponseData - } - tests := []struct { - name string - fields fields - args args - wantErr []error - wantResp *adapters.BidderResponse - }{ - { - name: "happy path, valid response with all bid params", - args: args{ - response: &adapters.ResponseData{ - StatusCode: http.StatusOK, - Body: []byte(`{"id": "test-request-id", "seatbid":[{"seat": "StickyAdsTv", "bid":[{"id": "7706636740145184841", "impid": "test-imp-id", "price": 0.500000, "adid": "29681110", "adm": "some-test-ad", "adomain":["freewheel.com"], "crid": "29681110", "dealid": "testdeal", "cat": ["IAB10"], "dur": 14 }, -{"id": "7706636740145184841", "impid": "test-imp-id", "price": 0.500000, "adid": "29681110", "adm": "some-test-ad", "adomain":["freewheel.com"], "crid": "29681110", "dealid": "testdeal", "Dur":10}]}], "bidid": "5778926625248726496", "cur": "USD"}`), - }, - }, - wantErr: nil, - wantResp: &adapters.BidderResponse{ - Bids: []*adapters.TypedBid{ - { - Bid: &openrtb2.Bid{ - ID: "7706636740145184841", - ImpID: "test-imp-id", - Price: 0.500000, - AdID: "29681110", - AdM: "some-test-ad", - ADomain: []string{"freewheel.com"}, - CrID: "29681110", - DealID: "testdeal", - Cat: []string{"IAB10"}, - Dur: 14, - }, - BidType: openrtb_ext.BidTypeVideo, - BidVideo: &openrtb_ext.ExtBidPrebidVideo{PrimaryCategory: "IAB10", Duration: 14}, - }, - { - Bid: &openrtb2.Bid{ - ID: "7706636740145184841", - ImpID: "test-imp-id", - Price: 0.500000, - AdID: "29681110", - AdM: "some-test-ad", - ADomain: []string{"freewheel.com"}, - CrID: "29681110", - DealID: "testdeal", - Dur: 10, - }, - BidType: openrtb_ext.BidTypeVideo, - BidVideo: &openrtb_ext.ExtBidPrebidVideo{Duration: 10}, - }, - }, - Currency: "USD", - }, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - a := &adapter{ - Endpoint: tt.fields.URI, - } - gotResp, gotErr := a.MakeBids(tt.args.internalRequest, tt.args.externalRequest, tt.args.response) - assert.Equal(t, tt.wantErr, gotErr) - assert.Equal(t, tt.wantResp, gotResp) - }) - } -} diff --git a/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json b/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json index 3060341c954..2562a812edc 100644 --- a/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json +++ b/adapters/freewheelssp/freewheelssptest/exemplary/multi-imp.json @@ -89,7 +89,10 @@ "adid": "7857", "adm": "", "cid": "4001", - "crid": "7857" + "crid": "7857", + "adomain":["freewheel.com"], + "cat": ["IAB10"], + "dur": 14 }, { "id": "12346_freewheelssp-test_2", @@ -98,7 +101,9 @@ "adid": "7933", "adm": "", "cid": "3476", - "crid": "7933" + "crid": "7933", + "adomain":["freewheel.com"], + "dur":10 } ], "seat": "freewheelsspTv" @@ -123,9 +128,16 @@ "adid": "7857", "adm": "", "cid": "4001", - "crid": "7857" + "crid": "7857", + "adomain":["freewheel.com"], + "cat": ["IAB10"], + "dur": 14 }, - "type": "video" + "type": "video", + "video" : { + "duration" : 14, + "primary_category": "IAB10" + } }, { "bid": { @@ -135,9 +147,14 @@ "adid": "7933", "adm": "", "cid": "3476", - "crid": "7933" + "crid": "7933", + "adomain":["freewheel.com"], + "dur":10 }, - "type": "video" + "type": "video", + "video" : { + "duration" : 10 + } } ] }