Skip to content

Commit

Permalink
Fixed naming convention issue for Pixfuture adapter to align with bes…
Browse files Browse the repository at this point in the history
…t practices and improve clarity
  • Loading branch information
pixfuture-media committed Dec 19, 2024
1 parent 22df0f8 commit a22b19e
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 22,661 deletions.
48 changes: 24 additions & 24 deletions adapters/pixfuture/coverage.out
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
mode: set
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20.119,25.2 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28.146,29.27 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:29.27,31.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:32.2,33.16 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:33.16,35.3 1 0
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:37.2,45.50 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:49.72,50.20 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:50.20,53.41 3 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:53.41,55.4 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:58.2,60.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:64.175,65.53 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:65.53,67.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:69.2,69.54 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:69.54,73.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:75.2,75.46 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:75.46,79.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:81.2,82.73 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:82.73,84.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:86.2,90.43 4 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:90.43,91.35 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:91.35,93.18 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:93.18,95.13 2 0
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:97.4,100.6 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:104.2,104.28 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:20.119,24.2 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:27.137,28.27 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:28.27,30.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:31.2,32.16 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:32.16,34.3 1 0
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:36.2,44.50 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:48.72,49.20 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:49.20,52.41 3 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:52.41,54.4 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:57.2,59.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:63.166,64.53 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:64.53,66.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:68.2,68.54 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:68.54,72.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:74.2,74.46 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:74.46,78.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:80.2,81.73 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:81.73,83.3 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:85.2,89.43 4 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:89.43,90.35 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:90.35,92.18 2 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:92.18,94.13 2 0
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:96.4,99.6 1 1
github.com/prebid/prebid-server/v3/adapters/pixfuture/pixfuture.go:103.2,103.28 1 1
11 changes: 5 additions & 6 deletions adapters/pixfuture/pixfuture.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,19 @@ import (
"github.com/prebid/prebid-server/v3/util/jsonutil"
)

type PixfutureAdapter struct {
type adapter struct {
endpoint string
}

// Builder builds a new instance of the Pixfuture adapter.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
bidder := &PixfutureAdapter{
return &adapter{
endpoint: config.Endpoint,
}
return bidder, nil
}, nil
}

// MakeRequests prepares and serializes HTTP requests to be sent to the Pixfuture endpoint.
func (a *PixfutureAdapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
func (a *adapter) MakeRequests(request *openrtb2.BidRequest, requestInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
if len(request.Imp) == 0 {
return nil, []error{&errortypes.BadInput{Message: "No impressions in the bid request"}}
}
Expand Down Expand Up @@ -61,7 +60,7 @@ func getMediaTypeForBid(bid openrtb2.Bid) (openrtb_ext.BidType, error) {
}

// MakeBids parses the HTTP response from the Pixfuture endpoint and generates a BidderResponse.
func (a *PixfutureAdapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) {
func (a *adapter) MakeBids(request *openrtb2.BidRequest, requestData *adapters.RequestData, responseData *adapters.ResponseData) (*adapters.BidderResponse, []error) {
if responseData.StatusCode == http.StatusNoContent {
return nil, nil
}
Expand Down
8 changes: 4 additions & 4 deletions adapters/pixfuture/pixfuture_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ func TestBuilder(t *testing.T) {
assert.NotNil(t, adapter, "expected a non-nil adapter instance")
}

func TestPixfutureAdapter_MakeRequests(t *testing.T) {
adapter := &PixfutureAdapter{endpoint: "https://mock-pixfuture-endpoint.com"}
func TestAdapter_MakeRequests(t *testing.T) {
adapter := &adapter{endpoint: "https://mock-pixfuture-endpoint.com"}

t.Run("Valid Request", func(t *testing.T) {
bidRequest := &openrtb2.BidRequest{
Expand Down Expand Up @@ -61,8 +61,8 @@ func TestPixfutureAdapter_MakeRequests(t *testing.T) {
})
}

func TestPixfutureAdapter_MakeBids(t *testing.T) {
adapter := &PixfutureAdapter{}
func TestAdapter_MakeBids(t *testing.T) {
adapter := &adapter{}

t.Run("Valid Response", func(t *testing.T) {
responseData := &adapters.ResponseData{
Expand Down
Loading

0 comments on commit a22b19e

Please sign in to comment.