Skip to content

Commit

Permalink
Tappx User Syncer + Site Update (prebid#1674)
Browse files Browse the repository at this point in the history
Co-authored-by: ubuntu <ahernandez@tappx.com>
Co-authored-by: Albert Grandes <agrandes@tappx.com>
  • Loading branch information
3 people authored and Dan Barnett committed May 11, 2021
1 parent 615608a commit 1ee9957
Show file tree
Hide file tree
Showing 22 changed files with 361 additions and 48 deletions.
6 changes: 3 additions & 3 deletions adapters/tappx/tappx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderTappx, config.Adapter{
Endpoint: "https://{{.Host}}"})
Endpoint: "http://{{.Host}}"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -30,7 +30,7 @@ func TestEndpointTemplateMalformed(t *testing.T) {

func TestTsValue(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderTappx, config.Adapter{
Endpoint: "https://{{.Host}}"})
Endpoint: "http://{{.Host}}"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -47,7 +47,7 @@ func TestTsValue(t *testing.T) {

url, err := bidderTappx.buildEndpointURL(&tappxExt, test)

match, err := regexp.MatchString(`https://example\.host\.tappx\.com/DUMMYENDPOINT\?tappxkey=dummy-tappx-key&ts=[0-9]{13}&type_cnn=prebid&v=1\.1`, url)
match, err := regexp.MatchString(`http://example\.host\.tappx\.com/DUMMYENDPOINT\?tappxkey=dummy-tappx-key&ts=[0-9]{13}&type_cnn=prebid&v=1\.1`, url)
if err != nil {
t.Errorf("Error while running regex validation: %s", err.Error())
return
Expand Down
10 changes: 5 additions & 5 deletions adapters/tappx/tappxtest/exemplary/single-banner-impression.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"ext": {
"bidder": {
"tappxkey": "pub-12345-android-9876",
"endpoint": "PREBIDTEMPLATE",
"host": "test.tappx.com"
"endpoint": "ZZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
}
}
Expand All @@ -33,7 +33,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1",
"uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1",
"body": {
"id": "0000000000001",
"test": 1,
Expand All @@ -47,8 +47,8 @@
"ext": {
"bidder": {
"tappxkey": "pub-12345-android-9876",
"endpoint": "PREBIDTEMPLATE",
"host": "test.tappx.com"
"endpoint": "ZZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
}
}
Expand Down
124 changes: 124 additions & 0 deletions adapters/tappx/tappxtest/exemplary/single-banner-site.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"mockBidRequest": {
"id": "0000000000001",
"test": 1,
"imp": [
{
"id": "adunit-1",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"bidder": {
"tappxkey": "pub-12345-site-9876",
"endpoint": "ZZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
}
}
],
"site": {
"id": "102855",
"cat": [ "IAB3-1" ],
"domain": "www.tappx.com",
"page": "https://www.tappx.com/example.html ",
"publisher": {
"id": "8953", "name": "publisher.com",
"cat": [ "IAB3-1" ],
"domain": "publisher.com"
}
},
"user": {
"buyeruid": "A-38327932832"
}
},

"httpCalls": [
{
"expectedRequest": {
"uri": "http://testing.ssp.tappx.com/rtb/v2/ZZ123456PS?tappxkey=pub-12345-site-9876&type_cnn=prebid&v=1.1",
"body": {
"id": "0000000000001",
"test": 1,
"imp": [
{
"id": "adunit-1",
"banner": {
"w": 300,
"h": 250
},
"ext": {
"bidder": {
"tappxkey": "pub-12345-site-9876",
"endpoint": "ZZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
}
}
],
"site": {
"id": "102855",
"cat": [ "IAB3-1" ],
"domain": "www.tappx.com",
"page": "https://www.tappx.com/example.html ",
"publisher": {
"id": "8953", "name": "publisher.com",
"cat": [ "IAB3-1" ],
"domain": "publisher.com"
}
},
"user": {
"buyeruid": "A-38327932832"
}
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "75472df2-1cb3-4f8e-9a28-10cb95fe05a4",
"seatbid": [{
"bid": [{
"id": "wehM-93KGr0_0_0",
"impid": "adunit-1",
"price": 0.5,
"cid": "3706",
"crid": "19005",
"adid": "19005",
"adm": "<!-- admarkup -->",
"cat": ["IAB2"],
"adomain": ["test.com"],
"h": 250,
"w": 300
}]
}],
"bidid": "wehM-93KGr0"
}
}
}
],

"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "wehM-93KGr0_0_0",
"impid": "adunit-1",
"price": 0.5,
"adm": "<!-- admarkup -->",
"adid": "19005",
"adomain": ["test.com"],
"cid": "3706",
"crid": "19005",
"w": 300,
"h": 250,
"cat": ["IAB2"]
},
"type": "banner"
}
]
}
]
}
10 changes: 5 additions & 5 deletions adapters/tappx/tappxtest/exemplary/single-video-impression.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"ext": {
"bidder": {
"tappxkey": "pub-12345-android-9876",
"endpoint": "PREBIDTEMPLATE",
"host": "test.tappx.com"
"endpoint": "VZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
}
}
Expand All @@ -35,7 +35,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "https://test.tappx.com/PREBIDTEMPLATE?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1",
"uri": "http://testing.ssp.tappx.com/rtb/v2/VZ123456PS?tappxkey=pub-12345-android-9876&type_cnn=prebid&v=1.1",
"body": {
"id": "0000000000001",
"test": 1,
Expand All @@ -51,8 +51,8 @@
},
"ext": {
"bidder": {
"endpoint": "PREBIDTEMPLATE",
"host": "test.tappx.com",
"endpoint": "VZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/",
"tappxkey": "pub-12345-android-9876"
}
}
Expand Down
136 changes: 136 additions & 0 deletions adapters/tappx/tappxtest/exemplary/single-video-site.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"mockBidRequest": {
"id": "0000000000001",
"test": 1,
"imp": [
{
"id": "video-adunit-2",
"video": {
"mimes": [
"video/mp4"
],
"w": 640,
"h": 480
},
"ext": {
"bidder": {
"tappxkey": "pub-12345-site-9876",
"endpoint": "VZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
}
}
],
"site": {
"id": "102855",
"cat": [ "IAB3-1" ],
"domain": "www.tappx.com",
"page": "https://www.tappx.com/example.html ",
"publisher": {
"id": "8953", "name": "publisher.com",
"cat": [ "IAB3-1" ],
"domain": "publisher.com"
}
},
"user": {
"buyeruid": "A-38327932832"
}
},
"httpCalls": [
{
"expectedRequest": {
"uri": "http://testing.ssp.tappx.com/rtb/v2/VZ123456PS?tappxkey=pub-12345-site-9876&type_cnn=prebid&v=1.1",
"body": {
"id": "0000000000001",
"test": 1,
"imp": [
{
"id": "video-adunit-2",
"video": {
"mimes": [
"video/mp4"
],
"w": 640,
"h": 480
},
"ext": {
"bidder": {
"endpoint": "VZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/",
"tappxkey": "pub-12345-site-9876"
}
}
}
],
"site": {
"id": "102855",
"cat": [ "IAB3-1" ],
"domain": "www.tappx.com",
"page": "https://www.tappx.com/example.html ",
"publisher": {
"id": "8953", "name": "publisher.com",
"cat": [ "IAB3-1" ],
"domain": "publisher.com"
}
},
"user": {
"buyeruid": "A-38327932832"
}
}
},
"mockResponse": {
"status": 200,
"body": {
"id": "75472df2-1cb3-4f8e-9a28-10cb95fe05a4",
"seatbid": [
{
"bid": [
{
"id": "bid02",
"impid": "video-adunit-2",
"price": 2.25,
"cid": "1001",
"crid": "2002",
"adid": "2002",
"adm": "<!-- vast wrapper -->",
"cat": [
"IAB2"
],
"adomain": [
"video-example.com"
]
}
]
}
],
"bidid": "wehM-93KGr0"
}
}
}
],
"expectedBidResponses": [
{
"currency": "USD",
"bids": [
{
"bid": {
"id": "bid02",
"impid": "video-adunit-2",
"price": 2.25,
"adm": "<!-- vast wrapper -->",
"adomain": [
"video-example.com"
],
"cid": "1001",
"adid": "2002",
"crid": "2002",
"cat": [
"IAB2"
]
},
"type": "video"
}
]
}
]
}
4 changes: 2 additions & 2 deletions adapters/tappx/tappxtest/params/race/banner.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tappxkey": "pub-12345-android-9876",
"endpoint": "PREBIDTEMPLATE",
"host": "test.tappx.com"
"endpoint": "ZZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
4 changes: 2 additions & 2 deletions adapters/tappx/tappxtest/params/race/video.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"tappxkey": "pub-12345-android-9876",
"endpoint": "PREBIDTEMPLATE",
"host": "test.tappx.com"
"endpoint": "VZ123456PS",
"host": "testing.ssp.tappx.com/rtb/v2/"
}
Loading

0 comments on commit 1ee9957

Please sign in to comment.