From f743645fb98d73e0a1b29b7f3f9286f514d03cd2 Mon Sep 17 00:00:00 2001 From: Romain N Date: Fri, 8 Nov 2024 20:11:16 +0100 Subject: [PATCH] [AUC-470] Fix and add tests --- .../multi-banner-multi-imp-type.json | 247 ++++++++++++++++++ .../exemplary/multi-banner.json | 4 + .../multi-impression-types-video-banner.json | 110 ++++++++ .../exemplary/native-app.json | 2 + .../exemplary/native-web.json | 2 + .../exemplary/simple-banner.json | 6 +- .../exemplary/simple-video.json | 2 + .../supplemental/request-site-recreated.json | 2 + 8 files changed, 373 insertions(+), 2 deletions(-) create mode 100644 adapters/smartadserver/smartadservertest/exemplary/multi-banner-multi-imp-type.json create mode 100644 adapters/smartadserver/smartadservertest/exemplary/multi-impression-types-video-banner.json diff --git a/adapters/smartadserver/smartadservertest/exemplary/multi-banner-multi-imp-type.json b/adapters/smartadserver/smartadservertest/exemplary/multi-banner-multi-imp-type.json new file mode 100644 index 00000000000..11808bf3a8f --- /dev/null +++ b/adapters/smartadserver/smartadservertest/exemplary/multi-banner-multi-imp-type.json @@ -0,0 +1,247 @@ +{ + "mockBidRequest": { + "id": "test-request-multi-id", + "imp": [ + { + "id": "test-imp-id-1", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 1 + ], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "siteId": 1, + "pageId": 2, + "formatId": 3, + "networkId": 73 + } + } + }, + { + "id": "test-imp-id-2", + "banner": { + "format": [ + { + "w": 300, + "h": 150 + } + ] + }, + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 1 + ], + "w": 920, + "h": 200 + }, + "ext": { + "bidder": { + "siteId": 1, + "pageId": 2, + "formatId": 4, + "networkId": 73 + } + } + } + ] + }, + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://ssb.smartadserver.com/api/bid?callerId=5", + "body": { + "id": "test-request-multi-id", + "imp": [ + { + "id": "test-imp-id-1", + "banner": { + "format": [ + { + "w": 728, + "h": 90 + } + ] + }, + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 1 + ], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "siteId": 1, + "pageId": 2, + "formatId": 3, + "networkId": 73 + } + } + } + ], + "site": { + "publisher": { + "id": "73" + } + } + }, + "impIDs": [ + "test-imp-id-1" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-multi-id", + "seatbid": [ + { + "seat": "smartadserver", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-1", + "price": 0.500000, + "adm": "some-test-ad", + "crid": "crid_10", + "mtype": 1, + "w": 728, + "h": 90 + } + ] + } + ], + "cur": "USD" + } + } + }, + { + "expectedRequest": { + "uri": "https://ssb.smartadserver.com/api/bid?callerId=5", + "body": { + "id": "test-request-multi-id", + "imp": [ + { + "id": "test-imp-id-2", + "banner": { + "format": [ + { + "w": 300, + "h": 150 + } + ] + }, + "video": { + "mimes": [ + "video/mp4" + ], + "protocols": [ + 1 + ], + "w": 920, + "h": 200 + }, + "ext": { + "bidder": { + "siteId": 1, + "pageId": 2, + "formatId": 4, + "networkId": 73 + } + } + } + ], + "site": { + "publisher": { + "id": "73" + } + } + }, + "impIDs": [ + "test-imp-id-2" + ] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-multi-id", + "seatbid": [ + { + "seat": "smartadserver", + "bid": [ + { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e801", + "impid": "test-imp-id-2", + "price": 0.800000, + "adm": "some-test-ad", + "crid": "crid_11", + "mtype": 2, + "w": 920, + "h": 200 + } + ] + } + ], + "cur": "USD" + } + } + } + ], + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-1", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "mtype": 1, + "w": 728, + "h": 90 + }, + "type": "banner" + } + ] + }, + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e801", + "impid": "test-imp-id-2", + "price": 0.8, + "adm": "some-test-ad", + "crid": "crid_11", + "mtype": 2, + "w": 920, + "h": 200 + }, + "type": "video" + } + ] + } + ] +} \ No newline at end of file diff --git a/adapters/smartadserver/smartadservertest/exemplary/multi-banner.json b/adapters/smartadserver/smartadservertest/exemplary/multi-banner.json index c50e0fa21d4..a47da513b9c 100644 --- a/adapters/smartadserver/smartadservertest/exemplary/multi-banner.json +++ b/adapters/smartadserver/smartadservertest/exemplary/multi-banner.json @@ -76,6 +76,7 @@ "price": 0.500000, "adm": "some-test-ad", "crid": "crid_10", + "mtype": 1, "h": 90, "w": 728 }] @@ -127,6 +128,7 @@ "price": 0.800000, "adm": "some-test-ad", "crid": "crid_11", + "mtype": 1, "h": 150, "w": 300 }] @@ -149,6 +151,7 @@ "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", + "mtype": 1, "w": 728, "h": 90 }, @@ -166,6 +169,7 @@ "price": 0.8, "adm": "some-test-ad", "crid": "crid_11", + "mtype": 1, "w": 300, "h": 150 }, diff --git a/adapters/smartadserver/smartadservertest/exemplary/multi-impression-types-video-banner.json b/adapters/smartadserver/smartadservertest/exemplary/multi-impression-types-video-banner.json new file mode 100644 index 00000000000..efa23762947 --- /dev/null +++ b/adapters/smartadserver/smartadservertest/exemplary/multi-impression-types-video-banner.json @@ -0,0 +1,110 @@ +{ + "mockBidRequest": { + "id": "test-request-multi-id", + "imp": [ + { + "id": "test-imp-id-1", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "video": { + "mimes": ["video/mp4"], + "protocols": [1], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "siteId": 1, + "pageId": 2, + "formatId": 3, + "networkId": 73 + } + } + } + ] + }, + + "httpCalls": [ + { + "expectedRequest": { + "uri": "https://ssb.smartadserver.com/api/bid?callerId=5", + "body": { + "id": "test-request-multi-id", + "imp": [ + { + "id": "test-imp-id-1", + "banner": { + "format": [{"w": 728, "h": 90}] + }, + "video": { + "mimes": ["video/mp4"], + "protocols": [1], + "w": 1024, + "h": 576 + }, + "ext": { + "bidder": { + "siteId": 1, + "pageId": 2, + "formatId": 3, + "networkId": 73 + } + } + } + ], + "site": { + "publisher": { + "id": "73" + } + } + }, + "impIDs":["test-imp-id-1"] + }, + "mockResponse": { + "status": 200, + "body": { + "id": "test-request-multi-type", + "seatbid": [ + { + "seat": "smartadserver", + "bid": [{ + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-video", + "price": 0.500000, + "adm": "some-test-ad", + "crid": "crid_10", + "mtype": 2, + "w": 1024, + "h": 576 + }] + } + ], + "cur": "USD" + } + } + } + ], + + "expectedBidResponses": [ + { + "currency": "USD", + "bids": [ + { + "bid": { + "id": "8ee514f1-b2b8-4abb-89fd-084437d1e800", + "impid": "test-imp-id-video", + "price": 0.5, + "adm": "some-test-ad", + "crid": "crid_10", + "mtype": 2, + "w": 1024, + "h": 576 + }, + "type": "video" + } + ] + } + ] + } + \ No newline at end of file diff --git a/adapters/smartadserver/smartadservertest/exemplary/native-app.json b/adapters/smartadserver/smartadservertest/exemplary/native-app.json index 5f03a61d6d0..80adbbbce53 100644 --- a/adapters/smartadserver/smartadservertest/exemplary/native-app.json +++ b/adapters/smartadserver/smartadservertest/exemplary/native-app.json @@ -225,6 +225,7 @@ "h": 0, "exp": 0, "qagmediarating": 0, + "mtype": 4, "ext": { "event_notification_token": { "payload": "4323.905895002584918328.1655998688532" @@ -255,6 +256,7 @@ "tripadvisor.com" ], "crid": "11116594", + "mtype": 4, "ext": { "event_notification_token": { "payload": "4323.905895002584918328.1655998688532" diff --git a/adapters/smartadserver/smartadservertest/exemplary/native-web.json b/adapters/smartadserver/smartadservertest/exemplary/native-web.json index 4c164c74a81..9523a71dddf 100644 --- a/adapters/smartadserver/smartadservertest/exemplary/native-web.json +++ b/adapters/smartadserver/smartadservertest/exemplary/native-web.json @@ -217,6 +217,7 @@ "h": 0, "exp": 0, "qagmediarating": 0, + "mtype": 4, "ext": { "event_notification_token": { "payload": "3305.295938731865870037.1656056869251" @@ -256,6 +257,7 @@ "colruyt.be" ], "crid": "431321529", + "mtype": 4, "ext": { "event_notification_token": { "payload": "3305.295938731865870037.1656056869251" diff --git a/adapters/smartadserver/smartadservertest/exemplary/simple-banner.json b/adapters/smartadserver/smartadservertest/exemplary/simple-banner.json index c47fee48888..a3f444de510 100644 --- a/adapters/smartadserver/smartadservertest/exemplary/simple-banner.json +++ b/adapters/smartadserver/smartadservertest/exemplary/simple-banner.json @@ -63,7 +63,8 @@ "adm": "some-test-ad", "crid": "crid_10", "h": 90, - "w": 728 + "w": 728, + "mtype": 1 }] } ], @@ -85,7 +86,8 @@ "adm": "some-test-ad", "crid": "crid_10", "w": 728, - "h": 90 + "h": 90, + "mtype": 1 }, "type": "banner" } diff --git a/adapters/smartadserver/smartadservertest/exemplary/simple-video.json b/adapters/smartadserver/smartadservertest/exemplary/simple-video.json index 62fd92aa130..c0286cc1fce 100644 --- a/adapters/smartadserver/smartadservertest/exemplary/simple-video.json +++ b/adapters/smartadserver/smartadservertest/exemplary/simple-video.json @@ -68,6 +68,7 @@ "price": 0.500000, "adm": "some-test-ad", "crid": "crid_10", + "mtype": 2, "h": 576, "w": 1024 }] @@ -90,6 +91,7 @@ "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", + "mtype": 2, "w": 1024, "h": 576 }, diff --git a/adapters/smartadserver/smartadservertest/supplemental/request-site-recreated.json b/adapters/smartadserver/smartadservertest/supplemental/request-site-recreated.json index 5bb369d8b94..98f4ffb1f98 100644 --- a/adapters/smartadserver/smartadservertest/supplemental/request-site-recreated.json +++ b/adapters/smartadserver/smartadservertest/supplemental/request-site-recreated.json @@ -67,6 +67,7 @@ "price": 0.500000, "adm": "some-test-ad", "crid": "crid_10", + "mtype": 1, "h": 90, "w": 728 }] @@ -89,6 +90,7 @@ "price": 0.5, "adm": "some-test-ad", "crid": "crid_10", + "mtype": 1, "w": 728, "h": 90 },