@@ -6,6 +6,7 @@ import org.prebid.server.functional.model.db.Account
6
6
import org.prebid.server.functional.model.db.StoredImp
7
7
import org.prebid.server.functional.model.db.StoredRequest
8
8
import org.prebid.server.functional.model.request.amp.AmpRequest
9
+ import org.prebid.server.functional.model.request.auction.Adrino
9
10
import org.prebid.server.functional.model.request.auction.AuctionEnvironment
10
11
import org.prebid.server.functional.model.request.auction.Banner
11
12
import org.prebid.server.functional.model.request.auction.BidRequest
@@ -1298,4 +1299,66 @@ class BidderParamsSpec extends BaseSpec {
1298
1299
assert bidderRequest. imp[0 ]. ext. auctionEnvironment == extAuctionEnv
1299
1300
assert bidderRequest. imp[0 ]. ext. interestGroupAuctionSupports. auctionEnvironment == extIgsAuctionEnv
1300
1301
}
1302
+
1303
+ def " PBS should reject alias bidders when bidder params from request doesn't satisfy own json-schema" () {
1304
+ given : " Default bid request"
1305
+ def bidRequest = BidRequest . defaultBidRequest. tap {
1306
+ imp[0 ]. ext. prebid. bidder. tap {
1307
+ it. generic. exampleProperty = PBSUtils . randomNumber
1308
+ // Adrino hard coded bidder alias in generic.yaml
1309
+ it. adrino = new Adrino (hash : PBSUtils . randomNumber)
1310
+ }
1311
+ }
1312
+
1313
+ when : " PBS processes auction request"
1314
+ def response = defaultPbsService. sendAuctionRequest(bidRequest)
1315
+
1316
+ then : " Bidder should be dropped"
1317
+ assert response. ext?. warnings[PREBID ]* . code == [999 , 999 , 999 ]
1318
+ assert response. ext?. warnings[PREBID ]* . message ==
1319
+ [" WARNING: request.imp[0].ext.prebid.bidder.generic was dropped with a reason: " +
1320
+ " request.imp[0].ext.prebid.bidder.generic failed validation.\n " +
1321
+ " \$ .exampleProperty: integer found, string expected" ,
1322
+ " WARNING: request.imp[0].ext.prebid.bidder.adrino was dropped with a reason: " +
1323
+ " request.imp[0].ext.prebid.bidder.adrino failed validation.\n " +
1324
+ " \$ .hash: integer found, string expected" ,
1325
+ " WARNING: request.imp[0].ext must contain at least one valid bidder" ]
1326
+
1327
+ and : " PBS should not call bidder"
1328
+ assert bidder. getRequestCount(bidRequest. id) == 0
1329
+
1330
+ and : " targeting should be empty"
1331
+ assert response. seatbid. isEmpty()
1332
+ }
1333
+
1334
+ def " PBS should reject alias bidders when bidder params from request doesn't satisfy aliased json-schema" () {
1335
+ given : " Default basic generic BidRequest"
1336
+ def bidRequest = BidRequest . defaultBidRequest. tap {
1337
+ imp[0 ]. ext. prebid. bidder. tap {
1338
+ it. generic. exampleProperty = PBSUtils . randomNumber
1339
+ // Nativo hard coded bidder alias in generic.yaml
1340
+ it. nativo = new Generic (exampleProperty : PBSUtils . randomNumber)
1341
+ }
1342
+ }
1343
+
1344
+ when : " PBS processes auction request"
1345
+ def response = defaultPbsService. sendAuctionRequest(bidRequest)
1346
+
1347
+ then : " Bidder should be dropped"
1348
+ assert response. ext?. warnings[PREBID ]* . code == [999 , 999 , 999 ]
1349
+ assert response. ext?. warnings[PREBID ]* . message ==
1350
+ [" WARNING: request.imp[0].ext.prebid.bidder.generic was dropped with a reason: " +
1351
+ " request.imp[0].ext.prebid.bidder.generic failed validation.\n " +
1352
+ " \$ .exampleProperty: integer found, string expected" ,
1353
+ " WARNING: request.imp[0].ext.prebid.bidder.nativo was dropped with a reason: " +
1354
+ " request.imp[0].ext.prebid.bidder.nativo failed validation.\n " +
1355
+ " \$ .exampleProperty: integer found, string expected" ,
1356
+ " WARNING: request.imp[0].ext must contain at least one valid bidder" ]
1357
+
1358
+ and : " PBS should not call bidder"
1359
+ assert bidder. getRequestCount(bidRequest. id) == 0
1360
+
1361
+ and : " targeting should be empty"
1362
+ assert response. seatbid. isEmpty()
1363
+ }
1301
1364
}
0 commit comments