Skip to content

Commit

Permalink
Bizzclick: rename bizzclick to blasto (#3688)
Browse files Browse the repository at this point in the history
  • Loading branch information
BizzClick committed Jul 1, 2024
1 parent a907ecb commit 670e1d4
Show file tree
Hide file tree
Showing 25 changed files with 144 additions and 155 deletions.
25 changes: 9 additions & 16 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,33 +87,26 @@ 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) {
host := "us-e-node1"
if params.Host != "" {
host = params.Host
}
func (a *adapter) buildEndpointURL(params *openrtb_ext.ExtBlasto) (string, error) {
sourceId := params.SourceID
if params.SourceID == "" {
sourceId = params.PlacementID
}
endpointParams := macros.EndpointTemplateParams{AccountID: params.AccountID, SourceId: sourceId, Host: host}
endpointParams := macros.EndpointTemplateParams{AccountID: params.AccountID, SourceId: sourceId}
return macros.ResolveMacros(a.endpoint, endpointParams)
}

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://t-us.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 @@ -34,8 +34,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
}
Expand All @@ -61,7 +60,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://t-us.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -97,7 +96,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -120,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 @@ -28,8 +28,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
},
Expand All @@ -43,8 +42,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
}
Expand All @@ -70,7 +68,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://t-us.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -108,7 +106,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 +144,7 @@
}
],
"type": "banner",
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"placementId": "placementId"
"sourceId": "sourceId"
}
}
}
Expand All @@ -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://t-us.blasto.ai/bid?rtb_seat_id=sourceId&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 @@ -34,8 +34,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
}
Expand All @@ -61,7 +60,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://t-us.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -97,7 +96,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -118,7 +119,7 @@
}
],
"type": "native",
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
}
Expand All @@ -55,7 +54,7 @@
"2607:fb90:f27:4512:d800:cb23:a603:e245"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://t-us.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -85,7 +84,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -105,7 +106,7 @@
"crid": "20"
}
],
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
}
Expand All @@ -66,7 +65,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://t-us.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -107,7 +106,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -129,7 +130,7 @@
"h": 720
}
],
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@
"ext": {
"bidder": {
"accountId": "accountId",
"sourceId": "sourceId",
"host": "host"
"sourceId": "sourceId"
}
}
}
Expand All @@ -60,7 +59,7 @@
"123.123.123.123"
]
},
"uri": "http://host.bizzclick.com/bid?rtb_seat_id=sourceId&secret_key=accountId",
"uri": "http://t-us.blasto.ai/bid?rtb_seat_id=sourceId&secret_key=accountId",
"body": {
"id": "some-request-id",
"device": {
Expand Down Expand Up @@ -95,7 +94,9 @@
},
"tmax": 1000
},
"impIDs":["some-impression-id"]
"impIDs": [
"some-impression-id"
]
},
"mockResponse": {
"status": 200,
Expand All @@ -122,7 +123,7 @@
}
}
],
"seat": "bizzclick"
"seat": "blasto"
}
],
"cur": "USD"
Expand Down
Loading

0 comments on commit 670e1d4

Please sign in to comment.