Skip to content

Commit

Permalink
Pass Host Config Info to Bid Adapters (prebid#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexBVolcy authored Oct 12, 2022
1 parent ba97299 commit c2e6c25
Show file tree
Hide file tree
Showing 318 changed files with 687 additions and 507 deletions.
2 changes: 1 addition & 1 deletion adapters/33across/33across.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func getBidType(ext bidExt) openrtb_ext.BidType {
}

// Builder builds a new instance of the 33Across adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
bidder := &TtxAdapter{
endpoint: config.Endpoint,
}
Expand Down
2 changes: 1 addition & 1 deletion adapters/33across/33across_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.Bidder33Across, config.Adapter{
Endpoint: "http://ssc.33across.com"})
Endpoint: "http://ssc.33across.com"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down
2 changes: 1 addition & 1 deletion adapters/aax/aax.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func (a *adapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest
}

// Builder builds a new instance of the Aax adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
url := buildEndpoint(config.Endpoint, config.ExtraAdapterInfo)
return &adapter{
endpoint: url,
Expand Down
7 changes: 4 additions & 3 deletions adapters/aax/aax_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package aax

import (
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"

"github.com/prebid/prebid-server/adapters/adapterstest"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/openrtb_ext"
Expand All @@ -13,7 +14,7 @@ func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAax, config.Adapter{
Endpoint: "https://example.aax.media/rtb/prebid",
ExtraAdapterInfo: "http://localhost:8080/extrnal_url",
})
}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -24,7 +25,7 @@ func TestJsonSamples(t *testing.T) {

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

assert.Nil(t, buildErr)
}
2 changes: 1 addition & 1 deletion adapters/aceex/aceex.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type adapter struct {
}

// Builder builds a new instance of the Aceex adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
template, err := template.New("endpointTemplate").Parse(config.Endpoint)
if err != nil {
return nil, fmt.Errorf("unable to parse endpoint url template: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions adapters/aceex/aceex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAceex, config.Adapter{
Endpoint: "http://us.example.com/bid?uqhash={{.AccountID}}"})
Endpoint: "http://us.example.com/bid?uqhash={{.AccountID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -22,7 +22,7 @@ func TestJsonSamples(t *testing.T) {

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

assert.Error(t, buildErr)
}
2 changes: 1 addition & 1 deletion adapters/acuityads/acuityads.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type AcuityAdsAdapter struct {
}

// Builder builds a new instance of the AcuityAds adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
template, err := template.New("endpointTemplate").Parse(config.Endpoint)
if err != nil {
return nil, fmt.Errorf("unable to parse endpoint url template: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions adapters/acuityads/acuityads_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAcuityAds, config.Adapter{
Endpoint: "http://{{.Host}}.example.com/bid?token={{.AccountID}}"})
Endpoint: "http://{{.Host}}.example.com/bid?token={{.AccountID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -22,7 +22,7 @@ func TestJsonSamples(t *testing.T) {

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

assert.Error(t, buildErr)
}
35 changes: 17 additions & 18 deletions adapters/adapterstest/test_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,37 @@ import (
// RunJSONBidderTest is a helper method intended to unit test Bidders' adapters.
// It requires that:
//
// 1. Bidders communicate with external servers over HTTP.
// 2. The HTTP request bodies are legal JSON.
// 1. Bidders communicate with external servers over HTTP.
// 2. The HTTP request bodies are legal JSON.
//
// Although the project does not require it, we _strongly_ recommend that all Bidders write tests using this.
// Doing so has the following benefits:
//
// 1. This includes some basic tests which confirm that your Bidder is "well-behaved" for all the input samples.
// For example, "no nil bids are allowed in the returned array".
// These tests are tedious to write, but help prevent bugs during auctions.
// 1. This includes some basic tests which confirm that your Bidder is "well-behaved" for all the input samples.
// For example, "no nil bids are allowed in the returned array".
// These tests are tedious to write, but help prevent bugs during auctions.
//
// 2. In the future, we plan to auto-generate documentation from the "exemplary" test files.
// Those docs will teach publishers how to use your Bidder, which should encourage adoption.
// 2. In the future, we plan to auto-generate documentation from the "exemplary" test files.
// Those docs will teach publishers how to use your Bidder, which should encourage adoption.
//
// To use this method, create *.json files in the following directories:
//
// adapters/{bidder}/{bidder}test/exemplary:
//
// These show "ideal" BidRequests for your Bidder. If possible, configure your servers to return the same
// expected responses forever. If your server responds appropriately, our future auto-generated documentation
// can guarantee Publishers that your adapter works as documented.
// These show "ideal" BidRequests for your Bidder. If possible, configure your servers to return the same
// expected responses forever. If your server responds appropriately, our future auto-generated documentation
// can guarantee Publishers that your adapter works as documented.
//
// adapters/{bidder}/{bidder}test/supplemental:
//
// Fill this with *.json files which are useful test cases, but are not appropriate for public example docs.
// For example, a file in this directory might make sure that a mobile-only Bidder returns errors on non-mobile requests.
// Fill this with *.json files which are useful test cases, but are not appropriate for public example docs.
// For example, a file in this directory might make sure that a mobile-only Bidder returns errors on non-mobile requests.
//
// Then create a test in your adapters/{bidder}/{bidder}_test.go file like so:
//
// func TestJsonSamples(t *testing.T) {
// adapterstest.RunJSONBidderTest(t, "{bidder}test", instanceOfYourBidder)
// }
//
// func TestJsonSamples(t *testing.T) {
// adapterstest.RunJSONBidderTest(t, "{bidder}test", instanceOfYourBidder)
// }
func RunJSONBidderTest(t *testing.T, rootDir string, bidder adapters.Bidder) {
runTests(t, fmt.Sprintf("%s/exemplary", rootDir), bidder, false, false, false)
runTests(t, fmt.Sprintf("%s/supplemental", rootDir), bidder, true, false, false)
Expand Down Expand Up @@ -369,9 +368,9 @@ func diffJson(description string, actual []byte, expected []byte) error {
// testMakeRequestsImpl asserts the resulting values of the bidder's `MakeRequests()` implementation
// against the expected JSON-defined results and ensures we do not encounter data races in the process.
// To assert no data races happen we make use of:
// 1) A shallow copy of the unmarshalled openrtb2.BidRequest that will provide reference values to
// 1. A shallow copy of the unmarshalled openrtb2.BidRequest that will provide reference values to
// shared memory that we don't want the adapters' implementation of `MakeRequests()` to modify.
// 2) A deep copy that will preserve the original values of all the fields. This copy remains untouched
// 2. A deep copy that will preserve the original values of all the fields. This copy remains untouched
// by the adapters' processes and serves as reference of what the shared memory values should still
// be after the `MakeRequests()` call.
func testMakeRequestsImpl(t *testing.T, filename string, spec *testSpec, bidder adapters.Bidder, reqInfo *adapters.ExtraRequestInfo) []*adapters.RequestData {
Expand Down
2 changes: 1 addition & 1 deletion adapters/adf/adf.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type adfRequestExt struct {
}

// Builder builds a new instance of the Adf adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
bidder := &adapter{
endpoint: config.Endpoint,
}
Expand Down
2 changes: 1 addition & 1 deletion adapters/adf/adf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdf, config.Adapter{
Endpoint: "https://adx.adform.net/adx/openrtb"})
Endpoint: "https://adx.adform.net/adx/openrtb"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down
2 changes: 1 addition & 1 deletion adapters/adgeneration/adgeneration.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ func removeWrapper(ad string) string {
}

// Builder builds a new instance of the Adgeneration adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
bidder := &AdgenerationAdapter{
config.Endpoint,
"1.0.3",
Expand Down
8 changes: 4 additions & 4 deletions adapters/adgeneration/adgeneration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdgeneration, config.Adapter{
Endpoint: "https://d.socdm.com/adsv/v1"})
Endpoint: "https://d.socdm.com/adsv/v1"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -25,7 +25,7 @@ func TestJsonSamples(t *testing.T) {

func TestGetRequestUri(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdgeneration, config.Adapter{
Endpoint: "https://d.socdm.com/adsv/v1"})
Endpoint: "https://d.socdm.com/adsv/v1"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down Expand Up @@ -133,7 +133,7 @@ func TestGetSizes(t *testing.T) {

func TestGetCurrency(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdgeneration, config.Adapter{
Endpoint: "https://d.socdm.com/adsv/v1"})
Endpoint: "https://d.socdm.com/adsv/v1"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down Expand Up @@ -204,7 +204,7 @@ func TestCreateAd(t *testing.T) {

func TestMakeBids(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdgeneration, config.Adapter{
Endpoint: "https://d.socdm.com/adsv/v1"})
Endpoint: "https://d.socdm.com/adsv/v1"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand Down
2 changes: 1 addition & 1 deletion adapters/adhese/adhese.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ func ContainsAny(raw string, keys []string) bool {
}

// Builder builds a new instance of the Adhese adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
template, err := template.New("endpointTemplate").Parse(config.Endpoint)
if err != nil {
return nil, fmt.Errorf("unable to parse endpoint url template: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions adapters/adhese/adhese_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdhese, config.Adapter{
Endpoint: "https://ads-{{.AccountID}}.adhese.com/json"})
Endpoint: "https://ads-{{.AccountID}}.adhese.com/json"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -22,7 +22,7 @@ func TestJsonSamples(t *testing.T) {

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

assert.Error(t, buildErr)
}
10 changes: 5 additions & 5 deletions adapters/adkernel/adkernel.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type adkernelAdapter struct {
EndpointTemplate *template.Template
}

//MakeRequests prepares request information for prebid-server core
// MakeRequests prepares request information for prebid-server core
func (adapter *adkernelAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
errs := make([]error, 0, len(request.Imp))
if len(request.Imp) == 0 {
Expand Down Expand Up @@ -84,7 +84,7 @@ func validateImpression(imp *openrtb2.Imp, impExt *openrtb_ext.ExtImpAdkernel) e
return nil
}

//Group impressions by AdKernel-specific parameter `zoneId`
// Group impressions by AdKernel-specific parameter `zoneId`
func dispatchImpressions(imps []openrtb2.Imp, impsExt []openrtb_ext.ExtImpAdkernel) (map[openrtb_ext.ExtImpAdkernel][]openrtb2.Imp, []error) {
res := make(map[openrtb_ext.ExtImpAdkernel][]openrtb2.Imp)
errors := make([]error, 0)
Expand All @@ -104,7 +104,7 @@ func dispatchImpressions(imps []openrtb2.Imp, impsExt []openrtb_ext.ExtImpAdkern
return res, errors
}

//Alter impression info to comply with adkernel platform requirements
// Alter impression info to comply with adkernel platform requirements
func compatImpression(imp *openrtb2.Imp) error {
imp.Ext = nil //do not forward ext to adkernel platform
if imp.Banner != nil {
Expand Down Expand Up @@ -204,7 +204,7 @@ func (adapter *adkernelAdapter) buildEndpointURL(params *openrtb_ext.ExtImpAdker
return macros.ResolveMacros(adapter.EndpointTemplate, endpointParams)
}

//MakeBids translates adkernel bid response to prebid-server specific format
// MakeBids translates adkernel bid response to prebid-server specific format
func (adapter *adkernelAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
if response.StatusCode == http.StatusNoContent {
return nil, nil
Expand Down Expand Up @@ -262,7 +262,7 @@ func newBadServerResponseError(message string) error {
}

// Builder builds a new instance of the Adkernel adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
urlTemplate, err := template.New("endpointTemplate").Parse(config.Endpoint)
if err != nil {
return nil, fmt.Errorf("unable to parse endpoint url template: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions adapters/adkernel/adkernel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdkernel, config.Adapter{
Endpoint: "https://pbs.adksrv.com/hb?zone={{.ZoneID}}"})
Endpoint: "https://pbs.adksrv.com/hb?zone={{.ZoneID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -22,7 +22,7 @@ func TestJsonSamples(t *testing.T) {

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

assert.Error(t, buildErr)
}
10 changes: 5 additions & 5 deletions adapters/adkernelAdn/adkernelAdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type adkernelAdnAdapter struct {
EndpointTemplate *template.Template
}

//MakeRequests prepares request information for prebid-server core
// MakeRequests prepares request information for prebid-server core
func (adapter *adkernelAdnAdapter) MakeRequests(request *openrtb2.BidRequest, reqInfo *adapters.ExtraRequestInfo) ([]*adapters.RequestData, []error) {
errs := make([]error, 0, len(request.Imp))
if len(request.Imp) == 0 {
Expand Down Expand Up @@ -85,7 +85,7 @@ func validateImpression(imp *openrtb2.Imp, impExt *openrtb_ext.ExtImpAdkernelAdn
return nil
}

//Group impressions by AdKernel-specific parameters `pubId` & `host`
// Group impressions by AdKernel-specific parameters `pubId` & `host`
func dispatchImpressions(imps []openrtb2.Imp, impsExt []openrtb_ext.ExtImpAdkernelAdn) (map[openrtb_ext.ExtImpAdkernelAdn][]openrtb2.Imp, []error) {
res := make(map[openrtb_ext.ExtImpAdkernelAdn][]openrtb2.Imp)
errors := make([]error, 0)
Expand All @@ -105,7 +105,7 @@ func dispatchImpressions(imps []openrtb2.Imp, impsExt []openrtb_ext.ExtImpAdkern
return res, errors
}

//Alter impression info to comply with adkernel platform requirements
// Alter impression info to comply with adkernel platform requirements
func compatImpression(imp *openrtb2.Imp) error {
imp.Ext = nil //do not forward ext to adkernel platform
if imp.Banner != nil {
Expand Down Expand Up @@ -214,7 +214,7 @@ func (adapter *adkernelAdnAdapter) buildEndpointURL(params *openrtb_ext.ExtImpAd
return macros.ResolveMacros(adapter.EndpointTemplate, endpointParams)
}

//MakeBids translates adkernel bid response to prebid-server specific format
// MakeBids translates adkernel bid response to prebid-server specific format
func (adapter *adkernelAdnAdapter) MakeBids(internalRequest *openrtb2.BidRequest, externalRequest *adapters.RequestData, response *adapters.ResponseData) (*adapters.BidderResponse, []error) {
if response.StatusCode == http.StatusNoContent {
return nil, nil
Expand Down Expand Up @@ -272,7 +272,7 @@ func newBadServerResponseError(message string) error {
}

// Builder builds a new instance of the AdkernelAdn adapter for the given bidder with the given config.
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter) (adapters.Bidder, error) {
func Builder(bidderName openrtb_ext.BidderName, config config.Adapter, server config.Server) (adapters.Bidder, error) {
template, err := template.New("endpointTemplate").Parse(config.Endpoint)
if err != nil {
return nil, fmt.Errorf("unable to parse endpoint url template: %v", err)
Expand Down
4 changes: 2 additions & 2 deletions adapters/adkernelAdn/adkernelAdn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestJsonSamples(t *testing.T) {
bidder, buildErr := Builder(openrtb_ext.BidderAdkernelAdn, config.Adapter{
Endpoint: "https://pbs2.adksrv.com/rtbpub?account={{.PublisherID}}"})
Endpoint: "https://pbs2.adksrv.com/rtbpub?account={{.PublisherID}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"})

if buildErr != nil {
t.Fatalf("Builder returned unexpected error %v", buildErr)
Expand All @@ -22,7 +22,7 @@ func TestJsonSamples(t *testing.T) {

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

assert.Error(t, buildErr)
}
Loading

0 comments on commit c2e6c25

Please sign in to comment.