forked from prebid/prebid-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
validateNativeContextTypes function test cases (prebid#1743)
- Loading branch information
1 parent
8a213f1
commit 8f9a8bf
Showing
7 changed files
with
189 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...ts/openrtb2/sample-requests/invalid-native/context-type-content-incompatible-subtype.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"description": "Native bid request. Context type content (1) is incompatible with 'social' subcontext types (20~29). Return error", | ||
"mockBidRequest": { | ||
"id": "req-id", | ||
"site": { | ||
"page": "some.page.com" | ||
}, | ||
"tmax": 500, | ||
"imp": [ | ||
{ | ||
"id": "some-imp", | ||
"native": { | ||
"request": "{\"context\":1,\"contextsubtype\":21,\"plcmttype\":1,\"assets\":[{\"title\":{\"len\":90}},{\"img\":{\"hmin\":30,\"wmin\":20}},{\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":5,\"maxduration\":10,\"protocols\":[1]}},{\"data\":{\"type\":2}}]}" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectedReturnCode": 400, | ||
"expectedErrorMessage": "Invalid request" | ||
} |
27 changes: 27 additions & 0 deletions
27
...ts/openrtb2/sample-requests/invalid-native/context-type-product-incompatible-subtype.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"description": "Native bid request. Context type product (3) is incompatible with 'social' subcontext types (10~19). Return error", | ||
"mockBidRequest": { | ||
"id": "req-id", | ||
"site": { | ||
"page": "some.page.com" | ||
}, | ||
"tmax": 500, | ||
"imp": [ | ||
{ | ||
"id": "some-imp", | ||
"native": { | ||
"request": "{\"context\":3,\"contextsubtype\":11,\"plcmttype\":1,\"assets\":[{\"title\":{\"len\":90}},{\"img\":{\"hmin\":30,\"wmin\":20}},{\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":5,\"maxduration\":10,\"protocols\":[1]}},{\"data\":{\"type\":2}}]}" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectedReturnCode": 400, | ||
"expectedErrorMessage": "Invalid request" | ||
} | ||
|
||
|
27 changes: 27 additions & 0 deletions
27
...nts/openrtb2/sample-requests/invalid-native/context-type-social-incompatible-subtype.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"description": "Native bid request. Context type social (2) is incompatible with 'product' subcontext types (30~39). Return error", | ||
"mockBidRequest": { | ||
"id": "req-id", | ||
"site": { | ||
"page": "some.page.com" | ||
}, | ||
"tmax": 500, | ||
"imp": [ | ||
{ | ||
"id": "some-imp", | ||
"native": { | ||
"request": "{\"context\":2,\"contextsubtype\":31,\"plcmttype\":1,\"assets\":[{\"title\":{\"len\":90}},{\"img\":{\"hmin\":30,\"wmin\":20}},{\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":5,\"maxduration\":10,\"protocols\":[1]}},{\"data\":{\"type\":2}}]}" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectedReturnCode": 400, | ||
"expectedErrorMessage": "Invalid request" | ||
} | ||
|
||
|
26 changes: 26 additions & 0 deletions
26
endpoints/openrtb2/sample-requests/invalid-native/contextsubtype-greater-than-max.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"description": "Native bid request comes with a subcontext type greater than 500. Return error", | ||
"mockBidRequest": { | ||
"id": "req-id", | ||
"site": { | ||
"page": "some.page.com" | ||
}, | ||
"tmax": 500, | ||
"imp": [ | ||
{ | ||
"id": "some-imp", | ||
"native": { | ||
"request": "{\"context\":1,\"contextsubtype\":550,\"plcmttype\":1,\"assets\":[{\"title\":{\"len\":90}},{\"img\":{\"hmin\":30,\"wmin\":20}},{\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":5,\"maxduration\":10,\"protocols\":[1]}},{\"data\":{\"type\":2}}]}" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectedReturnCode": 400, | ||
"expectedErrorMessage": "Invalid request" | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
endpoints/openrtb2/sample-requests/valid-native/context-product-compatible-subtype.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"description": "Native bid request comes with a context type product (3) and compatible subcontext type", | ||
"mockBidRequest": { | ||
"id": "req-id", | ||
"site": { | ||
"page": "some.page.com" | ||
}, | ||
"tmax": 500, | ||
"imp": [ | ||
{ | ||
"id": "some-imp", | ||
"native": { | ||
"request": "{\"context\":3,\"contextsubtype\":31,\"plcmttype\":1,\"assets\":[{\"title\":{\"len\":90}},{\"img\":{\"hmin\":30,\"wmin\":20}},{\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":5,\"maxduration\":10,\"protocols\":[1]}},{\"data\":{\"type\":2}}]}" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectedBidResponse": { | ||
"id": "req-id", | ||
"bidid": "test bid id", | ||
"nbr": 0, | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "appnexus-bid", | ||
"impid": "", | ||
"price": 0 | ||
} | ||
], | ||
"seat": "appnexus-bids" | ||
} | ||
] | ||
}, | ||
"expectedReturnCode": 200 | ||
} |
41 changes: 41 additions & 0 deletions
41
endpoints/openrtb2/sample-requests/valid-native/context-social-compatible-subtype.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
{ | ||
"description": "Native bid request comes with a context type social (2) and compatible subcontext type", | ||
"mockBidRequest": { | ||
"id": "req-id", | ||
"site": { | ||
"page": "some.page.com" | ||
}, | ||
"tmax": 500, | ||
"imp": [ | ||
{ | ||
"id": "some-imp", | ||
"native": { | ||
"request": "{\"context\":2,\"contextsubtype\":21,\"plcmttype\":1,\"assets\":[{\"title\":{\"len\":90}},{\"img\":{\"hmin\":30,\"wmin\":20}},{\"video\":{\"mimes\":[\"video/mp4\"],\"minduration\":5,\"maxduration\":10,\"protocols\":[1]}},{\"data\":{\"type\":2}}]}" | ||
}, | ||
"ext": { | ||
"appnexus": { | ||
"placementId": 12883451 | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"expectedBidResponse": { | ||
"id": "req-id", | ||
"bidid": "test bid id", | ||
"nbr": 0, | ||
"seatbid": [ | ||
{ | ||
"bid": [ | ||
{ | ||
"id": "appnexus-bid", | ||
"impid": "", | ||
"price": 0 | ||
} | ||
], | ||
"seat": "appnexus-bids" | ||
} | ||
] | ||
}, | ||
"expectedReturnCode": 200 | ||
} |