github.com/prebid/prebid-server/v2@v2.18.0/adapters/nextmillennium/nextmillennium_test.go (about) 1 package nextmillennium 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 TestJsonSamples(t *testing.T) { 13 bidder, buildErr := Builder(openrtb_ext.BidderNextMillennium, config.Adapter{ 14 Endpoint: "https://pbs.nextmillmedia.com/openrtb2/auction"}, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) 15 16 if buildErr != nil { 17 t.Fatalf("Builder returned unexpected error %v", buildErr) 18 } 19 20 adapterstest.RunJSONBidderTest(t, "nextmillenniumtest", bidder) 21 } 22 func TestWithExtraInfo(t *testing.T) { 23 bidder, buildErr := Builder(openrtb_ext.BidderNextMillennium, config.Adapter{ 24 Endpoint: "https://pbs.nextmillmedia.com/openrtb2/auction", 25 ExtraAdapterInfo: "{\"nmmFlags\":[\"flag1\",\"flag2\"]}", 26 }, config.Server{ExternalUrl: "http://hosturl.com", GvlID: 1, DataCenter: "2"}) 27 28 if buildErr != nil { 29 t.Fatalf("Builder returned unexpected error %v", buildErr) 30 } 31 bidderNextMillennium, _ := bidder.(*adapter) 32 assert.Equal(t, bidderNextMillennium.nmmFlags, []string{"flag1", "flag2"}) 33 }