github.com/prebid/prebid-server/v2@v2.18.0/adapters/trustedstack/trustedstack_test.go (about) 1 package trustedstack 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/assert" 7 8 "github.com/prebid/prebid-server/v2/adapters/adapterstest" 9 "github.com/prebid/prebid-server/v2/config" 10 "github.com/prebid/prebid-server/v2/openrtb_ext" 11 ) 12 13 func TestJsonSamples(t *testing.T) { 14 bidder, buildErr := Builder(openrtb_ext.BidderTrustedstack, config.Adapter{ 15 Endpoint: "https://example.trustedstack.com/rtb/prebid", 16 ExtraAdapterInfo: "http://localhost:8080/extrnal_url", 17 }, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) 18 19 if buildErr != nil { 20 t.Fatalf("Builder returned unexpected error %v", buildErr) 21 } 22 23 adapterstest.RunJSONBidderTest(t, "trustedstacktest", bidder) 24 } 25 26 func TestEndpointTemplateMalformed(t *testing.T) { 27 _, buildErr := Builder(openrtb_ext.BidderTrustedstack, config.Adapter{ 28 Endpoint: "{{Malformed}}"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) 29 30 assert.Nil(t, buildErr) 31 }