Skip to content

Commit

Permalink
fixed UT
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-priyanka-bagade committed Oct 11, 2024
1 parent adf66d5 commit f83f252
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion analytics/pubmatic/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func getGdprEnabledFlag(partnerConfigMap map[int]map[string]string) int {
}

// send function will send the owlogger to analytics endpoint
func send(rCtx *models.RequestCtx, url string, headers http.Header, mhc mhttp.MultiHttpContextInterface) {
var send = func(rCtx *models.RequestCtx, url string, headers http.Header, mhc mhttp.MultiHttpContextInterface) {
startTime := time.Now()
hc, _ := mhttp.NewHttpCall(url, "")

Expand Down
7 changes: 7 additions & 0 deletions analytics/pubmatic/pubmatic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package pubmatic

import (
"encoding/json"
"net/http"
"testing"

"github.com/prebid/openrtb/v20/openrtb2"
"github.com/prebid/prebid-server/v2/analytics"
"github.com/prebid/prebid-server/v2/analytics/pubmatic/mhttp"
"github.com/prebid/prebid-server/v2/config"
"github.com/prebid/prebid-server/v2/hooks/hookanalytics"
"github.com/prebid/prebid-server/v2/hooks/hookexecution"
Expand Down Expand Up @@ -37,6 +39,11 @@ func TestNewHTTPLogger(t *testing.T) {

// TestLogAuctionObject just increases code coverage, it does not validate anything
func TestLogAuctionObject(t *testing.T) {
oldSend := send
send = func(rCtx *models.RequestCtx, url string, headers http.Header, mhc mhttp.MultiHttpContextInterface) {}
defer func() {
send = oldSend
}()
tests := []struct {
name string
ao *analytics.AuctionObject
Expand Down

0 comments on commit f83f252

Please sign in to comment.