diff --git a/adapters/mobfoxpb/mobfoxpb.go b/adapters/mobfoxpb/mobfoxpb.go
index 5369c082c52..6982e419cd5 100644
--- a/adapters/mobfoxpb/mobfoxpb.go
+++ b/adapters/mobfoxpb/mobfoxpb.go
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"net/http"
+ "strings"
"github.com/buger/jsonparser"
"github.com/mxmCherry/openrtb"
@@ -13,6 +14,16 @@ import (
"github.com/prebid/prebid-server/openrtb_ext"
)
+const (
+ ROUTE_NATIVE = "o"
+ ROUTE_RTB = "rtb"
+ METHOD_NATIVE = "ortb"
+ METHOD_RTB = "req"
+ MACROS_ROUTE = "__route__"
+ MACROS_METHOD = "__method__"
+ MACROS_KEY = "__key__"
+)
+
type adapter struct {
URI string
}
@@ -28,21 +39,36 @@ func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters
// MakeRequests create bid request for mobfoxpb demand
func (a *adapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
var errs []error
- var err error
- var tagID string
-
+ var route string
+ var method string
var adapterRequests []*adapters.RequestData
+ requestURI := a.URI
reqCopy := *request
imp := request.Imp[0]
- tagID, err = jsonparser.GetString(imp.Ext, "bidder", "TagID")
- if err != nil {
- errs = append(errs, err)
+ tagID, errTag := jsonparser.GetString(imp.Ext, "bidder", "TagID")
+ key, errKey := jsonparser.GetString(imp.Ext, "bidder", "key")
+ if errTag != nil && errKey != nil {
+ errs = append(errs, &errortypes.BadInput{
+ Message: fmt.Sprintf("Invalid or non existing key and tagId, atleast one should be present"),
+ })
return nil, errs
}
- imp.TagID = tagID
+
+ if key != "" {
+ route = ROUTE_RTB
+ method = METHOD_RTB
+ requestURI = strings.Replace(requestURI, MACROS_KEY, key, 1)
+ } else if tagID != "" {
+ method = METHOD_NATIVE
+ route = ROUTE_NATIVE
+ }
+
+ requestURI = strings.Replace(requestURI, MACROS_ROUTE, route, 1)
+ requestURI = strings.Replace(requestURI, MACROS_METHOD, method, 1)
+
reqCopy.Imp = []openrtb.Imp{imp}
- adapterReq, err := a.makeRequest(&reqCopy)
+ adapterReq, err := a.makeRequest(&reqCopy, requestURI)
if err != nil {
errs = append(errs, err)
}
@@ -52,7 +78,7 @@ func (a *adapter) MakeRequests(request *openrtb.BidRequest, reqInfo *adapters.Ex
return adapterRequests, errs
}
-func (a *adapter) makeRequest(request *openrtb.BidRequest) (*adapters.RequestData, error) {
+func (a *adapter) makeRequest(request *openrtb.BidRequest, requestURI string) (*adapters.RequestData, error) {
reqJSON, err := json.Marshal(request)
if err != nil {
@@ -64,7 +90,7 @@ func (a *adapter) makeRequest(request *openrtb.BidRequest) (*adapters.RequestDat
headers.Add("Accept", "application/json")
return &adapters.RequestData{
Method: "POST",
- Uri: a.URI,
+ Uri: requestURI,
Body: reqJSON,
Headers: headers,
}, nil
@@ -98,11 +124,10 @@ func (a *adapter) MakeBids(internalRequest *openrtb.BidRequest, externalRequest
if err != nil {
errs = append(errs, err)
} else {
- b := &adapters.TypedBid{
+ bidResponse.Bids = append(bidResponse.Bids, &adapters.TypedBid{
Bid: &bid,
BidType: bidType,
- }
- bidResponse.Bids = append(bidResponse.Bids, b)
+ })
}
}
}
@@ -126,6 +151,6 @@ func getMediaTypeForImp(impID string, imps []openrtb.Imp) (openrtb_ext.BidType,
// This shouldnt happen. Lets handle it just incase by returning an error.
return "", &errortypes.BadServerResponse{
- Message: fmt.Sprintf("Failed to find impression \"%s\" ", impID),
+ Message: fmt.Sprintf("Failed to find impression \"%s\"", impID),
}
}
diff --git a/adapters/mobfoxpb/mobfoxpb_test.go b/adapters/mobfoxpb/mobfoxpb_test.go
index 271d30a97af..56ad948bcde 100644
--- a/adapters/mobfoxpb/mobfoxpb_test.go
+++ b/adapters/mobfoxpb/mobfoxpb_test.go
@@ -10,7 +10,7 @@ import (
func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderMobfoxpb, config.Adapter{
- Endpoint: "http://example.com/?c=o&m=ortb"})
+ Endpoint: "http://example.com/?c=__route__&m=__method__&key=__key__"})
if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
}
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner-direct-route.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner-direct-route.json
new file mode 100644
index 00000000000..fb6bd260f74
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner-direct-route.json
@@ -0,0 +1,128 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "key": "6"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ }
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=rtb&m=req&key=6",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "key": "6"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 300,
+ "h": 250,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "expectedBidResponses": [
+ {
+ "bids": [
+ {
+ "bid": {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 300,
+ "h": 250,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ },
+ "type": "banner"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner-rtb-route.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner-rtb-route.json
new file mode 100644
index 00000000000..7b38008536d
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner-rtb-route.json
@@ -0,0 +1,128 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "6"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ }
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "6"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 300,
+ "h": 250,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ }
+ ]
+ }
+ ]
+ }
+ }
+ }
+ ],
+ "expectedBidResponses": [
+ {
+ "bids": [
+ {
+ "bid": {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 300,
+ "h": 250,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ },
+ "type": "banner"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner.json
deleted file mode 100644
index b1936661a71..00000000000
--- a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-banner.json
+++ /dev/null
@@ -1,132 +0,0 @@
-{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "6",
- "ext": {
- "bidder": {
- "TagID": "6"
- }
- }
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- }
-},
-
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "6",
- "ext": {
- "bidder": {
- "TagID": "6"
- }
- }
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- }
- }
- },
- "mockResponse": {
- "status": 200,
- "body": {
- "id": "test-request-id",
- "seatbid": [
- {
- "bid": [
- {
- "id": "test_bid_id",
- "impid": "test-imp-id",
- "price": 0.27543,
- "adm": "",
- "cid": "test_cid",
- "crid": "test_crid",
- "dealid": "test_dealid",
- "w": 300,
- "h": 250,
- "ext": {
- "prebid": {
- "type": "banner"
- }
- }
- }
- ]
- }
- ]
- }
- }
- }
- ],
-
- "expectedBidResponses": [
- {
- "bids":[
- {
- "bid": {
- "id": "test_bid_id",
- "impid": "test-imp-id",
- "price": 0.27543,
- "adm": "",
- "cid": "test_cid",
- "crid": "test_crid",
- "dealid": "test_dealid",
- "w": 300,
- "h": 250,
- "ext": {
- "prebid": {
- "type": "banner"
- }
- }
- },
- "type": "banner"
- }
- ]
- }
- ]
-}
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video-direct-route.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video-direct-route.json
new file mode 100644
index 00000000000..a949fdb1527
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video-direct-route.json
@@ -0,0 +1,125 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ },
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "video": {
+ "mimes": [
+ "video/mp4"
+ ],
+ "protocols": [
+ 2,
+ 5
+ ],
+ "w": 1024,
+ "h": 576
+ },
+ "ext": {
+ "bidder": {
+ "key": "7"
+ }
+ }
+ }
+ ]
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=rtb&m=req&key=7",
+ "body": {
+ "id": "test-request-id",
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ },
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "video": {
+ "mimes": [
+ "video/mp4"
+ ],
+ "protocols": [
+ 2,
+ 5
+ ],
+ "w": 1024,
+ "h": 576
+ },
+ "ext": {
+ "bidder": {
+ "key": "7"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "00:01:00",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "ext": {
+ "prebid": {
+ "type": "video"
+ }
+ }
+ }
+ ],
+ "seat": "mobfoxpb"
+ }
+ ],
+ "cur": "USD"
+ }
+ }
+ }
+ ],
+ "expectedBidResponses": [
+ {
+ "currency": "USD",
+ "bids": [
+ {
+ "bid": {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "00:01:00",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "ext": {
+ "prebid": {
+ "type": "video"
+ }
+ }
+ },
+ "type": "video"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video-rtb-route.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video-rtb-route.json
new file mode 100644
index 00000000000..a33f0e62fc7
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video-rtb-route.json
@@ -0,0 +1,125 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ },
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "video": {
+ "mimes": [
+ "video/mp4"
+ ],
+ "protocols": [
+ 2,
+ 5
+ ],
+ "w": 1024,
+ "h": 576
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "7"
+ }
+ }
+ }
+ ]
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ },
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "video": {
+ "mimes": [
+ "video/mp4"
+ ],
+ "protocols": [
+ 2,
+ 5
+ ],
+ "w": 1024,
+ "h": 576
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "7"
+ }
+ }
+ }
+ ]
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "00:01:00",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "ext": {
+ "prebid": {
+ "type": "video"
+ }
+ }
+ }
+ ],
+ "seat": "mobfoxpb"
+ }
+ ],
+ "cur": "USD"
+ }
+ }
+ }
+ ],
+ "expectedBidResponses": [
+ {
+ "currency": "USD",
+ "bids": [
+ {
+ "bid": {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "00:01:00",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "ext": {
+ "prebid": {
+ "type": "video"
+ }
+ }
+ },
+ "type": "video"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video.json
deleted file mode 100644
index 6cdcdc5a6cc..00000000000
--- a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-video.json
+++ /dev/null
@@ -1,119 +0,0 @@
-{
- "mockBidRequest": {
- "id": "test-request-id",
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- },
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "imp": [
- {
- "id": "test-imp-id",
- "video": {
- "mimes": ["video/mp4"],
- "protocols": [2, 5],
- "w": 1024,
- "h": 576
- },
- "ext": {
- "bidder": {
- "TagID": "7"
- }
- }
- }
- ]
- },
-
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- },
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "imp": [
- {
- "id": "test-imp-id",
- "video": {
- "mimes": ["video/mp4"],
- "protocols": [2, 5],
- "w": 1024,
- "h": 576
- },
- "tagid": "7",
- "ext": {
- "bidder": {
- "TagID": "7"
- }
- }
- }
- ]
- }
- },
- "mockResponse": {
- "status": 200,
- "body": {
- "id": "test-request-id",
- "seatbid": [
- {
- "bid": [
- {
- "id": "test_bid_id",
- "impid": "test-imp-id",
- "price": 0.27543,
- "adm": "00:01:00",
- "cid": "test_cid",
- "crid": "test_crid",
- "dealid": "test_dealid",
- "ext": {
- "prebid": {
- "type": "video"
- }
- }
- }
- ],
- "seat": "mobfoxpb"
- }
- ],
- "cur": "USD"
- }
- }
- }
- ],
-
-
- "expectedBidResponses": [
- {
- "currency": "USD",
- "bids": [
- {
- "bid": {
- "id": "test_bid_id",
- "impid": "test-imp-id",
- "price": 0.27543,
- "adm": "00:01:00",
- "cid": "test_cid",
- "crid": "test_crid",
- "dealid": "test_dealid",
- "ext": {
- "prebid": {
- "type": "video"
- }
- }
- },
- "type": "video"
- }
- ]
- }
- ]
-}
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner-direct-route.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner-direct-route.json
new file mode 100644
index 00000000000..d8727226723
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner-direct-route.json
@@ -0,0 +1,128 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "key": "8"
+ }
+ }
+ }
+ ],
+ "site": {
+ "id": "1",
+ "domain": "test.com"
+ },
+ "device": {
+ "ip": "123.123.123.123"
+ }
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=rtb&m=req&key=8",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "key": "8"
+ }
+ }
+ }
+ ],
+ "site": {
+ "id": "1",
+ "domain": "test.com"
+ },
+ "device": {
+ "ip": "123.123.123.123"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 468,
+ "h": 60,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ }
+ ],
+ "seat": "mobfoxpb"
+ }
+ ],
+ "cur": "USD"
+ }
+ }
+ }
+ ],
+ "expectedBidResponses": [
+ {
+ "bids": [
+ {
+ "bid": {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 468,
+ "h": 60,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ },
+ "type": "banner"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner-rtb-route.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner-rtb-route.json
new file mode 100644
index 00000000000..adbb7173848
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner-rtb-route.json
@@ -0,0 +1,128 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "8"
+ }
+ }
+ }
+ ],
+ "site": {
+ "id": "1",
+ "domain": "test.com"
+ },
+ "device": {
+ "ip": "123.123.123.123"
+ }
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "8"
+ }
+ }
+ }
+ ],
+ "site": {
+ "id": "1",
+ "domain": "test.com"
+ },
+ "device": {
+ "ip": "123.123.123.123"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 468,
+ "h": 60,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ }
+ ],
+ "seat": "mobfoxpb"
+ }
+ ],
+ "cur": "USD"
+ }
+ }
+ }
+ ],
+ "expectedBidResponses": [
+ {
+ "bids": [
+ {
+ "bid": {
+ "id": "test_bid_id",
+ "impid": "test-imp-id",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 468,
+ "h": 60,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ },
+ "type": "banner"
+ }
+ ]
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner.json b/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner.json
deleted file mode 100644
index bba728ac1e9..00000000000
--- a/adapters/mobfoxpb/mobfoxpbtest/exemplary/simple-web-banner.json
+++ /dev/null
@@ -1,130 +0,0 @@
-{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "8",
- "ext": {
- "bidder": {
- "TagID": "8"
- }
- }
- }
- ],
- "site": {
- "id": "1",
- "domain": "test.com"
- },
- "device": {
- "ip": "123.123.123.123"
- }
- },
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "8",
- "ext": {
- "bidder": {
- "TagID": "8"
- }
- }
- }
- ],
- "site": {
- "id": "1",
- "domain": "test.com"
- },
- "device": {
- "ip": "123.123.123.123"
- }
- }
- },
- "mockResponse": {
- "status": 200,
- "body": {
- "id": "test-request-id",
- "seatbid": [
- {
- "bid": [
- {
- "id": "test_bid_id",
- "impid": "test-imp-id",
- "price": 0.27543,
- "adm": "",
- "cid": "test_cid",
- "crid": "test_crid",
- "dealid": "test_dealid",
- "w": 468,
- "h": 60,
- "ext": {
- "prebid": {
- "type": "banner"
- }
- }
- }
- ],
- "seat": "mobfoxpb"
- }
- ],
- "cur": "USD"
- }
- }
- }
- ],
- "expectedBidResponses": [
- {
- "bids": [
- {
- "bid": {
- "id": "test_bid_id",
- "impid": "test-imp-id",
- "price": 0.27543,
- "adm": "",
- "cid": "test_cid",
- "crid": "test_crid",
- "dealid": "test_dealid",
- "w": 468,
- "h": 60,
- "ext": {
- "prebid": {
- "type": "banner"
- }
- }
- },
- "type": "banner"
- }
- ]
- }
- ]
-}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/params/race/banner-direct-route.json b/adapters/mobfoxpb/mobfoxpbtest/params/race/banner-direct-route.json
new file mode 100644
index 00000000000..3ffcd9bf63c
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/params/race/banner-direct-route.json
@@ -0,0 +1,3 @@
+{
+ "TagID": "6"
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/params/race/banner-rtb-route.json b/adapters/mobfoxpb/mobfoxpbtest/params/race/banner-rtb-route.json
new file mode 100644
index 00000000000..3ce815613d1
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/params/race/banner-rtb-route.json
@@ -0,0 +1,3 @@
+{
+ "key": "6"
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/params/race/banner.json b/adapters/mobfoxpb/mobfoxpbtest/params/race/banner.json
deleted file mode 100644
index dbdac1ad995..00000000000
--- a/adapters/mobfoxpb/mobfoxpbtest/params/race/banner.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "TagID": "6"
-}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/params/race/video-direct-route.json b/adapters/mobfoxpb/mobfoxpbtest/params/race/video-direct-route.json
new file mode 100644
index 00000000000..1e42cfc4a05
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/params/race/video-direct-route.json
@@ -0,0 +1,3 @@
+{
+ "TagID": "7"
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/params/race/video-rtb-route.json b/adapters/mobfoxpb/mobfoxpbtest/params/race/video-rtb-route.json
new file mode 100644
index 00000000000..8c4421b65ef
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/params/race/video-rtb-route.json
@@ -0,0 +1,3 @@
+{
+ "key": "7"
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/params/race/video.json b/adapters/mobfoxpb/mobfoxpbtest/params/race/video.json
deleted file mode 100644
index 6e2e0b3803b..00000000000
--- a/adapters/mobfoxpb/mobfoxpbtest/params/race/video.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "TagID": "7"
-}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad-imp-ext.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad-imp-ext.json
index ac3dce598eb..6f2b95a8c54 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad-imp-ext.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad-imp-ext.json
@@ -1,42 +1,41 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "mobfoxpb": {
+ "TagID": "6"
+ }
+ }
}
- ]
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
},
- "tagid": "6",
- "ext": {
- "mobfoxpb": {
- "TagID": "6"
- }
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
}
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
},
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- }
- },
- "expectedMakeRequestsErrors": [
- {
- "value": "Key path not found",
- "comparison": "literal"
- }
- ]
+ "expectedMakeRequestsErrors": [
+ {
+ "value": "Invalid or non existing key and tagId, atleast one should be present",
+ "comparison": "literal"
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_response.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_response.json
index 2f834c92be7..efd1ac90d9d 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_response.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_response.json
@@ -1,87 +1,85 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "17",
- "ext": {
- "bidder": {
- "TagID": "17"
- }
- }
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "device": {
- "ip": "123.123.123.123",
- "ifa": "sdjfksdf-dfsds-dsdg-dsgg"
- }
- },
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "17",
- "ext": {
- "bidder": {
- "TagID": "17"
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "17"
+ }
}
- }
}
- ],
- "app": {
+ ],
+ "app": {
"id": "1",
"bundle": "com.wls.testwlsapplication"
- },
- "device": {
+ },
+ "device": {
"ip": "123.123.123.123",
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
- }
}
- },
- "mockResponse": {
- "status": 200,
- "body": ""
- }
- }
- ],
- "expectedMakeBidsErrors": [
- {
- "value": "json: cannot unmarshal string into Go value of type openrtb.BidResponse",
- "comparison": "literal"
- }
- ]
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "17"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "sdjfksdf-dfsds-dsdg-dsgg"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": ""
+ }
+ }
+ ],
+ "expectedMakeBidsErrors": [
+ {
+ "value": "json: cannot unmarshal string into Go value of type openrtb.BidResponse",
+ "comparison": "literal"
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_status_code.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_status_code.json
index 96d3a649109..60ee36e48e3 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_status_code.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/bad_status_code.json
@@ -1,81 +1,79 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "100000000"
+ }
+ }
}
- ]
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
},
- "tagid": "100000000",
- "ext": {
- "bidder": {
- "TagID": "100000000"
- }
- }
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
+ "device": {}
},
- "device": {}
- },
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "100000000",
- "ext": {
- "bidder": {
- "TagID": "100000000"
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "100000000"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {}
}
- }
+ },
+ "mockResponse": {
+ "status": 400,
+ "body": {}
}
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "device": {}
}
- },
- "mockResponse": {
- "status": 400,
- "body": {}
- }
- }
- ],
- "expectedMakeBidsErrors": [
- {
- "value": "Unexpected status code: 400. Run with request.debug = 1 for more info",
- "comparison": "literal"
- }
- ]
+ ],
+ "expectedMakeBidsErrors": [
+ {
+ "value": "Unexpected status code: 400. Run with request.debug = 1 for more info",
+ "comparison": "literal"
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_empty_object.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_empty_object.json
index cc56fa25c2c..9179916e922 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_empty_object.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_empty_object.json
@@ -1,38 +1,37 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {}
}
- ]
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
},
- "tagid": "6",
- "ext": {}
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ }
},
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- }
- },
- "expectedMakeRequestsErrors": [
- {
- "value": "Key path not found",
- "comparison": "literal"
- }
- ]
+ "expectedMakeRequestsErrors": [
+ {
+ "value": "Invalid or non existing key and tagId, atleast one should be present",
+ "comparison": "literal"
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_string.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_string.json
index 464c9e31e39..45c32a1aa63 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_string.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/imp_ext_string.json
@@ -1,38 +1,37 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": ""
}
- ]
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
},
- "tagid": "6",
- "ext": ""
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
+ }
},
- "device": {
- "ip": "123.123.123.123",
- "ifa": "zxcjbzxmc-zxcbmz-zxbcz-zxczx"
- }
- },
- "expectedMakeRequestsErrors": [
- {
- "value": "Key path not found",
- "comparison": "literal"
- }
- ]
+ "expectedMakeRequestsErrors": [
+ {
+ "value": "Invalid or non existing key and tagId, atleast one should be present",
+ "comparison": "literal"
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/missmatch_bid_id.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/missmatch_bid_id.json
new file mode 100644
index 00000000000..28a1b6c72d4
--- /dev/null
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/missmatch_bid_id.json
@@ -0,0 +1,109 @@
+{
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "8"
+ }
+ }
+ }
+ ],
+ "site": {
+ "id": "1",
+ "domain": "test.com"
+ },
+ "device": {
+ "ip": "123.123.123.123"
+ }
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "8"
+ }
+ }
+ }
+ ],
+ "site": {
+ "id": "1",
+ "domain": "test.com"
+ },
+ "device": {
+ "ip": "123.123.123.123"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 200,
+ "body": {
+ "id": "test-request-id",
+ "seatbid": [
+ {
+ "bid": [
+ {
+ "id": "test_bid_id",
+ "impid": "test-imp-id-not",
+ "price": 0.27543,
+ "adm": "",
+ "cid": "test_cid",
+ "crid": "test_crid",
+ "dealid": "test_dealid",
+ "w": 468,
+ "h": 60,
+ "ext": {
+ "prebid": {
+ "type": "banner"
+ }
+ }
+ }
+ ],
+ "seat": "mobfoxpb"
+ }
+ ],
+ "cur": "USD"
+ }
+ }
+ }
+ ],
+ "expectedMakeBidsErrors": [
+ {
+ "value": "Failed to find impression \"test-imp-id-not\"",
+ "comparison": "literal"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-204.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-204.json
index c1091969991..e69b248d2a1 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-204.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-204.json
@@ -1,82 +1,80 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "17",
- "ext": {
- "bidder": {
- "TagID": "17"
- }
- }
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "device": {
- "ip": "123.123.123.123",
- "ifa": "sdjfksdf-dfsds-dsdg-dsgg"
- }
- },
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "17",
- "ext": {
- "bidder": {
- "TagID": "17"
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "17"
+ }
}
- }
}
- ],
- "app": {
+ ],
+ "app": {
"id": "1",
"bundle": "com.wls.testwlsapplication"
- },
- "device": {
+ },
+ "device": {
"ip": "123.123.123.123",
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
- }
}
- },
- "expectedBidResponses": [],
- "mockResponse": {
- "status": 204,
- "body": {}
- }
- }
- ]
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "17"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "sdjfksdf-dfsds-dsdg-dsgg"
+ }
+ }
+ },
+ "expectedBidResponses": [],
+ "mockResponse": {
+ "status": 204,
+ "body": {}
+ }
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-404.json b/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-404.json
index d9ef7108017..987b9daf980 100644
--- a/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-404.json
+++ b/adapters/mobfoxpb/mobfoxpbtest/supplemental/status-404.json
@@ -1,87 +1,85 @@
{
- "mockBidRequest": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
+ "mockBidRequest": {
+ "id": "test-request-id",
+ "imp": [
{
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "100000000",
- "ext": {
- "bidder": {
- "TagID": "100000000"
- }
- }
- }
- ],
- "app": {
- "id": "1",
- "bundle": "com.wls.testwlsapplication"
- },
- "device": {
- "ip": "123.123.123.123",
- "ifa": "sdjfksdf-dfsds-dsdg-dsgg"
- }
- },
- "httpCalls": [
- {
- "expectedRequest": {
- "uri": "http://example.com/?c=o&m=ortb",
- "body": {
- "id": "test-request-id",
- "imp": [
- {
- "id": "test-imp-id",
- "banner": {
- "format": [
- {
- "w": 300,
- "h": 250
- },
- {
- "w": 300,
- "h": 600
- }
- ]
- },
- "tagid": "100000000",
- "ext": {
- "bidder": {
- "TagID": "100000000"
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "100000000"
+ }
}
- }
}
- ],
- "app": {
+ ],
+ "app": {
"id": "1",
"bundle": "com.wls.testwlsapplication"
- },
- "device": {
+ },
+ "device": {
"ip": "123.123.123.123",
"ifa": "sdjfksdf-dfsds-dsdg-dsgg"
- }
}
- },
- "mockResponse": {
- "status": 404,
- "body": {}
- }
- }
- ],
- "expectedMakeBidsErrors": [
- {
- "value": "Unexpected status code: 404. Run with request.debug = 1 for more info",
- "comparison": "literal"
- }
- ]
+ },
+ "httpCalls": [
+ {
+ "expectedRequest": {
+ "uri": "http://example.com/?c=o&m=ortb&key=__key__",
+ "body": {
+ "id": "test-request-id",
+ "imp": [
+ {
+ "id": "test-imp-id",
+ "banner": {
+ "format": [
+ {
+ "w": 300,
+ "h": 250
+ },
+ {
+ "w": 300,
+ "h": 600
+ }
+ ]
+ },
+ "ext": {
+ "bidder": {
+ "TagID": "100000000"
+ }
+ }
+ }
+ ],
+ "app": {
+ "id": "1",
+ "bundle": "com.wls.testwlsapplication"
+ },
+ "device": {
+ "ip": "123.123.123.123",
+ "ifa": "sdjfksdf-dfsds-dsdg-dsgg"
+ }
+ }
+ },
+ "mockResponse": {
+ "status": 404,
+ "body": {}
+ }
+ }
+ ],
+ "expectedMakeBidsErrors": [
+ {
+ "value": "Unexpected status code: 404. Run with request.debug = 1 for more info",
+ "comparison": "literal"
+ }
+ ]
}
\ No newline at end of file
diff --git a/adapters/mobfoxpb/params_test.go b/adapters/mobfoxpb/params_test.go
index 59b9ec383c8..799fdcfa61b 100644
--- a/adapters/mobfoxpb/params_test.go
+++ b/adapters/mobfoxpb/params_test.go
@@ -37,6 +37,7 @@ func TestInvalidParams(t *testing.T) {
var validParams = []string{
`{"TagID": "6"}`,
+ `{"key": "1"}`,
}
var invalidParams = []string{
@@ -44,4 +45,7 @@ var invalidParams = []string{
`{"tagid": "123"}`,
`{"TagID": 16}`,
`{"TagID": ""}`,
+ `{"Key": "1"}`,
+ `{"key": 1}`,
+ `{"key":""}`,
}
diff --git a/config/config.go b/config/config.go
index 3a7ad509e1c..f16a3c856ea 100644
--- a/config/config.go
+++ b/config/config.go
@@ -855,7 +855,7 @@ func SetupViper(v *viper.Viper, filename string) {
v.SetDefault("adapters.mediafuse.endpoint", "http://ghb.hbmp.mediafuse.com/pbs/ortb")
v.SetDefault("adapters.mgid.endpoint", "https://prebid.mgid.com/prebid/")
v.SetDefault("adapters.mobilefuse.endpoint", "http://mfx.mobilefuse.com/openrtb?pub_id={{.PublisherID}}")
- v.SetDefault("adapters.mobfoxpb.endpoint", "http://bes.mobfox.com/?c=o&m=ortb")
+ v.SetDefault("adapters.mobfoxpb.endpoint", "http://bes.mobfox.com/?c=__route__&m=__method__&key=__key__")
v.SetDefault("adapters.nanointeractive.endpoint", "https://ad.audiencemanager.de/hbs")
v.SetDefault("adapters.ninthdecimal.endpoint", "http://rtb.ninthdecimal.com/xp/get?pubid={{.PublisherID}}")
v.SetDefault("adapters.nobid.endpoint", "https://ads.servenobid.com/ortb_adreq?tek=pbs&ver=1")
diff --git a/static/bidder-params/mobfoxpb.json b/static/bidder-params/mobfoxpb.json
index 0cc7a16c026..40ce83abc8e 100644
--- a/static/bidder-params/mobfoxpb.json
+++ b/static/bidder-params/mobfoxpb.json
@@ -1,14 +1,30 @@
{
- "$schema": "http://json-schema.org/draft-04/schema#",
- "title": "Mobfox Adapter Params",
- "description": "A schema which validates params accepted by the Mobfox adapter",
- "type": "object",
- "properties": {
- "TagID": {
- "type": "string",
- "minLength": 1,
- "description": "An ID which identifies the mobfox ad tag"
- }
- },
- "required" : [ "TagID" ]
-}
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "title": "Mobfox Adapter Params",
+ "description": "A schema which validates params accepted by the Mobfox adapter",
+ "type": "object",
+ "properties": {
+ "TagID": {
+ "type": "string",
+ "minLength": 1,
+ "description": "An ID which identifies the mobfox ad tag"
+ },
+ "key": {
+ "type": "string",
+ "minLength": 1,
+ "description": "An ID which identifies the mobfox adexchange partner"
+ }
+ },
+ "oneOf": [
+ {
+ "required": [
+ "TagID"
+ ]
+ },
+ {
+ "required": [
+ "key"
+ ]
+ }
+ ]
+}
\ No newline at end of file