diff --git a/adapters/eplanning/eplanning.go b/adapters/eplanning/eplanning.go index bd1c37d41c3..a3f9be385b9 100644 --- a/adapters/eplanning/eplanning.go +++ b/adapters/eplanning/eplanning.go @@ -196,17 +196,9 @@ func (adapter *EPlanningAdapter) MakeRequests(request *openrtb2.BidRequest, reqI query.Set("vv", vastVersionDefault) } if request.Source != nil && request.Source.Ext != nil { - var randNum int - if adapter.testing { - randNum = 1 - } else { - randNum = rand.Intn(1000) - } - if randNum == 1 { - if openRtbSchain := unmarshalSupplyChain(request); openRtbSchain != nil { - if schainValue := makeSupplyChain(*openRtbSchain); schainValue != "" { - query.Set("sch", schainValue) - } + if openRtbSchain := unmarshalSupplyChain(request); openRtbSchain != nil && len(openRtbSchain.Nodes) > 2 { + if schainValue := makeSupplyChain(*openRtbSchain); schainValue != "" { + query.Set("sch", schainValue) } } } diff --git a/adapters/eplanning/eplanningtest/supplemental/bid-with-2-nodes-schain.json b/adapters/eplanning/eplanningtest/supplemental/bid-with-2-nodes-schain.json new file mode 100644 index 00000000000..08773aeae70 --- /dev/null +++ b/adapters/eplanning/eplanningtest/supplemental/bid-with-2-nodes-schain.json @@ -0,0 +1,100 @@ +{ + "mockBidRequest": { + "id": "test-request-id", + "source": { + "ext": { + "schain": { + "ver": "1.0", + "complete": 1, + "nodes": [ + { + "asi": "exchange1.com", + "sid": "1234", + "hp": 1, + "ext": "text" + }, + { + "asi": "exchange2.com", + "sid": "abcd", + "hp": 1, + "ext": 1 + } + ] + } + } + }, + "imp": [ + { + "id": "test-imp-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + }, + { + "w": 300, + "h": 600 + } + ] + }, + "ext": { + "bidder": { + "ci": "12345" + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "http://rtb.e-planning.net/pbs/1/12345/1/FILE/ROS?e=300x250%3A300x250&ncb=1&ur=FILE", + "body": {}, + "impIDs":["test-imp-id"] + }, + "mockResponse": { + "status": 200, + "body": { + "sI": { "k": "12345" }, + "sec": "ROS", + "sp": [ + { + "k": "300x250", + "a": [{ + "i": "123456789abcdef", + "pr": "0.5", + "adm": "
test
", + "crid": "abcdef123456789", + "id": "adid12345", + "w": 300, + "h": 250 + }] + } + ] + } + } + } + ], + + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "123456789abcdef", + "impid": "test-imp-id", + "price": 0.5, + "adm": "
test
", + "adid": "adid12345", + "crid": "abcdef123456789", + "w": 300, + "h": 250 + }, + "type": "banner" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/eplanning/eplanningtest/supplemental/bid-with-schain.json b/adapters/eplanning/eplanningtest/supplemental/bid-with-schain.json index 637c02a9797..a84ff2d56f4 100644 --- a/adapters/eplanning/eplanningtest/supplemental/bid-with-schain.json +++ b/adapters/eplanning/eplanningtest/supplemental/bid-with-schain.json @@ -18,6 +18,12 @@ "sid": "abcd", "hp": 1, "ext": 1 + }, + { + "asi": "exchange3.com", + "sid": "abcdf", + "hp": 1, + "ext": 1 } ] } @@ -49,7 +55,7 @@ "httpCalls": [ { "expectedRequest": { - "uri": "http://rtb.e-planning.net/pbs/1/12345/1/FILE/ROS?e=300x250%3A300x250&ncb=1&sch=1.0%2C1%21exchange1.com%2C1234%2C1%2C%2C%2C%2C%2522text%2522%21exchange2.com%2Cabcd%2C1%2C%2C%2C%2C1&ur=FILE", + "uri": "http://rtb.e-planning.net/pbs/1/12345/1/FILE/ROS?e=300x250%3A300x250&ncb=1&sch=1.0%2C1%21exchange1.com%2C1234%2C1%2C%2C%2C%2C%2522text%2522%21exchange2.com%2Cabcd%2C1%2C%2C%2C%2C1%21exchange3.com%2Cabcdf%2C1%2C%2C%2C%2C1&ur=FILE", "body": {}, "impIDs":["test-imp-id"] },