github.com/prebid/prebid-server/v2@v2.18.0/adapters/telaria/telaria_test.go (about) 1 package telaria 2 3 import ( 4 "testing" 5 6 "github.com/prebid/prebid-server/v2/adapters/adapterstest" 7 "github.com/prebid/prebid-server/v2/config" 8 "github.com/prebid/prebid-server/v2/openrtb_ext" 9 "github.com/stretchr/testify/assert" 10 ) 11 12 func TestEndpointFromConfig(t *testing.T) { 13 bidder, buildErr := Builder(openrtb_ext.BidderTelaria, config.Adapter{ 14 Endpoint: "providedurl.com", 15 }, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) 16 17 if buildErr != nil { 18 t.Fatalf("Builder returned unexpected error %v", buildErr) 19 } 20 21 bidderTelari := bidder.(*TelariaAdapter) 22 23 assert.Equal(t, "providedurl.com", bidderTelari.URI) 24 } 25 26 func TestJsonSamples(t *testing.T) { 27 bidder, buildErr := Builder(openrtb_ext.BidderTelaria, config.Adapter{}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) 28 29 if buildErr != nil { 30 t.Fatalf("Builder returned unexpected error %v", buildErr) 31 } 32 33 adapterstest.RunJSONBidderTest(t, "telariatest", bidder) 34 }