Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bizzclick: rename bizzclick to blasto #3688

Merged
merged 6 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
16 changes: 8 additions & 8 deletions adapters/bizzclick/bizzclick.go → adapters/blasto/blasto.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bizzclick
package blasto

import (
"encoding/json"
Expand Down Expand Up @@ -60,15 +60,15 @@ func (a *adapter) MakeRequests(
requestsToBidder []*adapters.RequestData,
errs []error,
) {
bizzclickExt, err := a.getImpressionExt(&openRTBRequest.Imp[0])
blastoExt, err := a.getImpressionExt(&openRTBRequest.Imp[0])
if err != nil {
return nil, []error{err}
}

for idx := range openRTBRequest.Imp {
openRTBRequest.Imp[idx].Ext = nil
}
url, err := a.buildEndpointURL(bizzclickExt)
url, err := a.buildEndpointURL(blastoExt)
if err != nil {
return nil, []error{err}
}
Expand All @@ -87,24 +87,24 @@ func (a *adapter) MakeRequests(
}}, nil
}

func (a *adapter) getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.ExtBizzclick, error) {
func (a *adapter) getImpressionExt(imp *openrtb2.Imp) (*openrtb_ext.ExtBlasto, error) {
var bidderExt adapters.ExtImpBidder
if err := json.Unmarshal(imp.Ext, &bidderExt); err != nil {
return nil, &errortypes.BadInput{
Message: "ext.bidder not provided",
}
}
var bizzclickExt openrtb_ext.ExtBizzclick
if err := json.Unmarshal(bidderExt.Bidder, &bizzclickExt); err != nil {
var blastoExt openrtb_ext.ExtBlasto
if err := json.Unmarshal(bidderExt.Bidder, &blastoExt); err != nil {
return nil, &errortypes.BadInput{
Message: "ext.bidder not provided",
}
}

return &bizzclickExt, nil
return &blastoExt, nil
}

func (a *adapter) buildEndpointURL(params *openrtb_ext.ExtBizzclick) (string, error) {
func (a *adapter) buildEndpointURL(params *openrtb_ext.ExtBlasto) (string, error) {
host := "us-e-node1"
if params.Host != "" {
host = params.Host
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package bizzclick
package blasto

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

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderBizzclick, config.Adapter{
Endpoint: "http://{{.Host}}.bizzclick.com/bid?rtb_seat_id={{.SourceId}}&secret_key={{.AccountID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})
bidder, buildErr := Builder(openrtb_ext.BidderBlasto, config.Adapter{
Endpoint: "http://{{.Host}}.blasto.ai/bid?rtb_seat_id={{.SourceId}}&secret_key={{.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, "bizzclicktest", bidder)
adapterstest.RunJSONBidderTest(t, "blastotest", bidder)
}

func TestEndpointTemplateMalformed(t *testing.T) {
_, buildErr := Builder(openrtb_ext.BidderBizzclick, config.Adapter{
_, buildErr := Builder(openrtb_ext.BidderBlasto, 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 @@ -61,7 +61,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -97,7 +97,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -120,7 +122,7 @@
}
],
"type": "banner",
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -108,7 +108,10 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id1","some-impression-id2"]
"impIDs": [
"some-impression-id1",
"some-impression-id2"
]
},
"mockResponse": {
"status": 200,
Expand Down Expand Up @@ -143,7 +146,7 @@
}
],
"type": "banner",
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"123.123.123.123"
]
},
"uri": "http://us-e-node1.bizzclick.com/bid?rtb_seat_id=placementId&secret_key=accountId",
"uri": "http://us-e-node1.blasto.ai/bid?rtb_seat_id=placementId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -96,7 +96,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -119,7 +121,7 @@
}
],
"type": "banner",
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -97,7 +97,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -118,7 +120,7 @@
}
],
"type": "native",
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"2607:fb90:f27:4512:d800:cb23:a603:e245"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -85,7 +85,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -105,7 +107,7 @@
"crid": "20"
}
],
"seat": "bizzclick"
"seat": "blasto"
}
],
"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://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -107,7 +107,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -129,7 +131,7 @@
"h": 720
}
],
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=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 @@ -122,7 +124,7 @@
}
}
],
"seat": "bizzclick"
"seat": "blasto"
}
],
"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://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -107,7 +107,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 @@ -61,7 +61,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -97,7 +97,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 @@ -43,7 +43,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -78,7 +78,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 @@ -37,7 +37,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -66,7 +66,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 @@ -37,7 +37,7 @@
"httpCalls": [
{
"expectedRequest": {
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://host.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"imp": [
Expand Down Expand Up @@ -66,7 +66,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 306
Expand Down
Loading
Loading