Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions adapters/gothamads/gothamads.go → adapters/intenze/intenze.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gothamads
package intenze

import (
"encoding/json"
Expand Down Expand Up @@ -81,24 +81,24 @@ func (a *adapter) MakeRequests(openRTBRequest *openrtb2.BidRequest, reqInfo *ada
}}, nil
}

func getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.ExtGothamAds, error) {
func getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.ExtIntenze, error) {
var bidderExt adapters.ExtImpBidder
if err := jsonutil.Unmarshal(imp.Ext, &bidderExt); err != nil {
return nil, &errortypes.BadInput{
Message: err.Error(),
}
}
var gothamadsExt openrtb_ext.ExtGothamAds
if err := jsonutil.Unmarshal(bidderExt.Bidder, &gothamadsExt); err != nil {
var intenzeExt openrtb_ext.ExtIntenze
if err := jsonutil.Unmarshal(bidderExt.Bidder, &intenzeExt); err != nil {
return nil, &errortypes.BadInput{
Message: err.Error(),
}
}

return &gothamadsExt, nil
return &intenzeExt, nil
}

func (a *adapter) buildEndpointURL(params *openrtb_ext.ExtGothamAds) (string, error) {
func (a *adapter) buildEndpointURL(params *openrtb_ext.ExtIntenze) (string, error) {
endpointParams := macros.EndpointTemplateParams{AccountID: params.AccountID}
return macros.ResolveMacros(a.endpoint, endpointParams)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package gothamads
package intenze

import (
"testing"
Expand All @@ -10,18 +10,18 @@ import (
)

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderGothamads, config.Adapter{
Endpoint: "http://us-e-node1.gothamads.com/?pass={{.AccountID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
bidder, buildErr := Builder(openrtb_ext.BidderIntenze, config.Adapter{
Endpoint: "http://lb-east.intenze.co/?pass={{.AccountID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
}

adapterstest.RunJSONBidderTest(t, "gothamadstest", bidder)
adapterstest.RunJSONBidderTest(t, "intenzetest", bidder)
}

func TestEndpointTemplateMalformed(t *testing.T) {
_, buildErr := Builder(openrtb_ext.BidderGothamads, config.Adapter{
_, buildErr := Builder(openrtb_ext.BidderIntenze, config.Adapter{
Endpoint: "{{Malformed}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

assert.Error(t, buildErr)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -95,7 +95,9 @@
},
"tmax": 1000
},
"impIDs":["1"]
"impIDs": [
"1"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -119,7 +121,7 @@
}
],
"type": "banner",
"seat": "gothamAds"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -109,7 +109,10 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id1","some-impression-id2"]
"impIDs": [
"some-impression-id1",
"some-impression-id2"
]
},
"mockResponse": {
"status": 200,
Expand Down Expand Up @@ -146,7 +149,7 @@
}
],
"type": "banner",
"seat": "gothamads"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -95,7 +95,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -117,7 +119,7 @@
}
],
"type": "native",
"seat": "gothamads"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"2607:fb90:f27:4512:d800:cb23:a603:e245"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -83,7 +83,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -104,7 +106,7 @@
"mtype": 4
}
],
"seat": "gothamads"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -105,7 +105,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -128,7 +130,7 @@
"mtype": 2
}
],
"seat": "gothamads"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -93,7 +93,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand Down Expand Up @@ -121,7 +123,7 @@
"mtype": 2
}
],
"seat": "gothamads"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -95,7 +95,9 @@
},
"tmax": 1000
},
"impIDs":["1"]
"impIDs": [
"1"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -118,7 +120,7 @@
}
],
"mtype": 0,
"seat": "gothamads"
"seat": "intenze"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -105,7 +105,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -95,7 +95,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -76,7 +76,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 400
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -64,7 +64,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 204
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -64,7 +64,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 306
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://us-e-node1.gothamads.com/?pass=accountId",
"uri": "http://lb-east.intenze.co/?pass=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -64,7 +64,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 503
Expand Down
Loading
Loading