From 49f55bd863f096be437853508828016f57163215 Mon Sep 17 00:00:00 2001 From: banakemi Date: Thu, 23 Dec 2021 13:39:17 +0900 Subject: [PATCH 1/2] update test --- adapters/adgeneration/adgeneration_test.go | 2 +- .../exemplary/single-banner-android.json | 166 ++++++++++++++++++ .../exemplary/single-banner-ios.json | 166 ++++++++++++++++++ .../exemplary/single-banner.json | 11 +- 4 files changed, 342 insertions(+), 3 deletions(-) create mode 100644 adapters/adgeneration/adgenerationtest/exemplary/single-banner-android.json create mode 100644 adapters/adgeneration/adgenerationtest/exemplary/single-banner-ios.json diff --git a/adapters/adgeneration/adgeneration_test.go b/adapters/adgeneration/adgeneration_test.go index d5d93ac4e0b..c186f19f4c5 100644 --- a/adapters/adgeneration/adgeneration_test.go +++ b/adapters/adgeneration/adgeneration_test.go @@ -23,7 +23,7 @@ func TestJsonSamples(t *testing.T) { adapterstest.RunJSONBidderTest(t, "adgenerationtest", bidder) } -func TestgetRequestUri(t *testing.T) { +func TestGetRequestUri(t *testing.T) { bidder, buildErr := Builder(openrtb_ext.BidderAdgeneration, config.Adapter{ Endpoint: "https://d.socdm.com/adsv/v1"}) diff --git a/adapters/adgeneration/adgenerationtest/exemplary/single-banner-android.json b/adapters/adgeneration/adgenerationtest/exemplary/single-banner-android.json new file mode 100644 index 00000000000..33d4f87dc95 --- /dev/null +++ b/adapters/adgeneration/adgenerationtest/exemplary/single-banner-android.json @@ -0,0 +1,166 @@ +{ + "mockBidRequest":{ + "id": "some-request-id", + "site": { + "page": "http://example.com/test.html" + }, + "device": { + "ua": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36", + "ip": "000.000.00.00", + "os": "android", + "ifa": "advertising_id" + }, + "app": { + "name": "adgneration" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "bidder": { + "id": "58278" + } + } + } + ], + "tmax": 500 + }, + "httpCalls": [ + { + "internalRequest": { + "id": "some-request-id", + "site": { + "page": "http://example.com/test.html" + }, + "imp": [ + { + "id": "some-impression-id", + "banner": { + "format": [ + { + "w": 300, + "h": 250 + } + ] + }, + "ext": { + "bidder": { + "id": "58278" + } + } + } + ], + "tmax": 500 + }, + "expectedRequest":{ + "uri": "https://d.socdm.com/adsv/v1?adapterver=1.0.3&advertising_id=advertising_id&appname=adgneration¤cy=JPY&hb=true&id=58278&posall=SSPLOC&sdkname=prebidserver&sdktype=1&sizes=300x250&t=json3&tp=http%3A%2F%2Fexample.com%2Ftest.html", + "headers": { + "Accept": [ + "application/json" + ], + "Content-Type": [ + "application/json;charset=utf-8" + ], + "User-Agent": [ + "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36" + ], + "X-Forwarded-For": [ + "000.000.00.00" + ] + } + }, + "mockResponse":{ + "status": 200, + "body": { + "ad": "\n \n \n