@@ -2538,49 +2538,102 @@ describe('The Criteo bidding adapter', function () {
2538
2538
} ) ;
2539
2539
2540
2540
it ( 'should properly parse a bid response with FLEDGE auction configs' , function ( ) {
2541
+ let auctionConfig1 = {
2542
+ auctionSignals : { } ,
2543
+ decisionLogicUrl : 'https://grid-mercury.criteo.com/fledge/decision' ,
2544
+ interestGroupBuyers : [ 'https://first-buyer-domain.com' , 'https://second-buyer-domain.com' ] ,
2545
+ perBuyerSignals : {
2546
+ 'https://first-buyer-domain.com' : {
2547
+ foo : 'bar' ,
2548
+ } ,
2549
+ 'https://second-buyer-domain.com' : {
2550
+ foo : 'baz'
2551
+ } ,
2552
+ } ,
2553
+ perBuyerTimeout : {
2554
+ '*' : 500 ,
2555
+ 'buyer1' : 100 ,
2556
+ 'buyer2' : 200
2557
+ } ,
2558
+ perBuyerGroupLimits : {
2559
+ '*' : 60 ,
2560
+ 'buyer1' : 300 ,
2561
+ 'buyer2' : 400
2562
+ } ,
2563
+ seller : 'https://seller-domain.com' ,
2564
+ sellerTimeout : 500 ,
2565
+ sellerSignals : {
2566
+ foo : 'bar' ,
2567
+ foo2 : 'bar2' ,
2568
+ floor : 1 ,
2569
+ currency : 'USD' ,
2570
+ perBuyerTimeout : {
2571
+ 'buyer1' : 100 ,
2572
+ 'buyer2' : 200
2573
+ } ,
2574
+ perBuyerGroupLimits : {
2575
+ 'buyer1' : 300 ,
2576
+ 'buyer2' : 400
2577
+ } ,
2578
+ } ,
2579
+ sellerCurrency : 'USD' ,
2580
+ } ;
2581
+ let auctionConfig2 = {
2582
+ auctionSignals : { } ,
2583
+ decisionLogicUrl : 'https://grid-mercury.criteo.com/fledge/decision' ,
2584
+ interestGroupBuyers : [ 'https://first-buyer-domain.com' , 'https://second-buyer-domain.com' ] ,
2585
+ perBuyerSignals : {
2586
+ 'https://first-buyer-domain.com' : {
2587
+ foo : 'bar' ,
2588
+ } ,
2589
+ 'https://second-buyer-domain.com' : {
2590
+ foo : 'baz'
2591
+ } ,
2592
+ } ,
2593
+ perBuyerTimeout : {
2594
+ '*' : 500 ,
2595
+ 'buyer1' : 100 ,
2596
+ 'buyer2' : 200
2597
+ } ,
2598
+ perBuyerGroupLimits : {
2599
+ '*' : 60 ,
2600
+ 'buyer1' : 300 ,
2601
+ 'buyer2' : 400
2602
+ } ,
2603
+ seller : 'https://seller-domain.com' ,
2604
+ sellerTimeout : 500 ,
2605
+ sellerSignals : {
2606
+ foo : 'bar' ,
2607
+ floor : 1 ,
2608
+ perBuyerTimeout : {
2609
+ 'buyer1' : 100 ,
2610
+ 'buyer2' : 200
2611
+ } ,
2612
+ perBuyerGroupLimits : {
2613
+ 'buyer1' : 300 ,
2614
+ 'buyer2' : 400
2615
+ } ,
2616
+ } ,
2617
+ sellerCurrency : '???'
2618
+ } ;
2541
2619
const response = {
2542
2620
body : {
2543
2621
ext : {
2544
- igbid : [ {
2622
+ igi : [ {
2545
2623
impid : 'test-bidId' ,
2546
- igbuyer : [ {
2547
- origin : 'https://first-buyer-domain.com' ,
2548
- buyerdata : {
2549
- foo : 'bar' ,
2550
- } ,
2551
- } , {
2552
- origin : 'https://second-buyer-domain.com' ,
2553
- buyerdata : {
2554
- foo : 'baz' ,
2555
- } ,
2624
+ igs : [ {
2625
+ impid : 'test-bidId' ,
2626
+ bidId : 'test-bidId' ,
2627
+ config : auctionConfig1
2556
2628
} ]
2557
2629
} , {
2558
2630
impid : 'test-bidId-2' ,
2559
- igbuyer : [ {
2560
- origin : 'https://first-buyer-domain.com' ,
2561
- buyerdata : {
2562
- foo : 'bar' ,
2563
- } ,
2564
- } , {
2565
- origin : 'https://second-buyer-domain.com' ,
2566
- buyerdata : {
2567
- foo : 'baz' ,
2568
- } ,
2631
+ igs : [ {
2632
+ impid : 'test-bidId-2' ,
2633
+ bidId : 'test-bidId-2' ,
2634
+ config : auctionConfig2
2569
2635
} ]
2570
- } ] ,
2571
- seller : 'https://seller-domain.com' ,
2572
- sellerTimeout : 500 ,
2573
- sellerSignals : {
2574
- foo : 'bar' ,
2575
- perBuyerTimeout : { 'buyer1' : 100 , 'buyer2' : 200 } ,
2576
- perBuyerGroupLimits : { 'buyer1' : 300 , 'buyer2' : 400 } ,
2577
- } ,
2578
- sellerSignalsPerImp : {
2579
- 'test-bidId' : {
2580
- foo2 : 'bar2' ,
2581
- currency : 'USD'
2582
- } ,
2583
- } ,
2636
+ } ]
2584
2637
} ,
2585
2638
} ,
2586
2639
} ;
@@ -2631,87 +2684,13 @@ describe('The Criteo bidding adapter', function () {
2631
2684
expect ( interpretedResponse . fledgeAuctionConfigs ) . to . have . lengthOf ( 2 ) ;
2632
2685
expect ( interpretedResponse . fledgeAuctionConfigs [ 0 ] ) . to . deep . equal ( {
2633
2686
bidId : 'test-bidId' ,
2634
- config : {
2635
- auctionSignals : { } ,
2636
- decisionLogicUrl : 'https://grid-mercury.criteo.com/fledge/decision' ,
2637
- interestGroupBuyers : [ 'https://first-buyer-domain.com' , 'https://second-buyer-domain.com' ] ,
2638
- perBuyerSignals : {
2639
- 'https://first-buyer-domain.com' : {
2640
- foo : 'bar' ,
2641
- } ,
2642
- 'https://second-buyer-domain.com' : {
2643
- foo : 'baz'
2644
- } ,
2645
- } ,
2646
- perBuyerTimeout : {
2647
- '*' : 500 ,
2648
- 'buyer1' : 100 ,
2649
- 'buyer2' : 200
2650
- } ,
2651
- perBuyerGroupLimits : {
2652
- '*' : 60 ,
2653
- 'buyer1' : 300 ,
2654
- 'buyer2' : 400
2655
- } ,
2656
- seller : 'https://seller-domain.com' ,
2657
- sellerTimeout : 500 ,
2658
- sellerSignals : {
2659
- foo : 'bar' ,
2660
- foo2 : 'bar2' ,
2661
- floor : 1 ,
2662
- currency : 'USD' ,
2663
- perBuyerTimeout : {
2664
- 'buyer1' : 100 ,
2665
- 'buyer2' : 200
2666
- } ,
2667
- perBuyerGroupLimits : {
2668
- 'buyer1' : 300 ,
2669
- 'buyer2' : 400
2670
- } ,
2671
- } ,
2672
- sellerCurrency : 'USD' ,
2673
- } ,
2687
+ impid : 'test-bidId' ,
2688
+ config : auctionConfig1 ,
2674
2689
} ) ;
2675
2690
expect ( interpretedResponse . fledgeAuctionConfigs [ 1 ] ) . to . deep . equal ( {
2676
2691
bidId : 'test-bidId-2' ,
2677
- config : {
2678
- auctionSignals : { } ,
2679
- decisionLogicUrl : 'https://grid-mercury.criteo.com/fledge/decision' ,
2680
- interestGroupBuyers : [ 'https://first-buyer-domain.com' , 'https://second-buyer-domain.com' ] ,
2681
- perBuyerSignals : {
2682
- 'https://first-buyer-domain.com' : {
2683
- foo : 'bar' ,
2684
- } ,
2685
- 'https://second-buyer-domain.com' : {
2686
- foo : 'baz'
2687
- } ,
2688
- } ,
2689
- perBuyerTimeout : {
2690
- '*' : 500 ,
2691
- 'buyer1' : 100 ,
2692
- 'buyer2' : 200
2693
- } ,
2694
- perBuyerGroupLimits : {
2695
- '*' : 60 ,
2696
- 'buyer1' : 300 ,
2697
- 'buyer2' : 400
2698
- } ,
2699
- seller : 'https://seller-domain.com' ,
2700
- sellerTimeout : 500 ,
2701
- sellerSignals : {
2702
- foo : 'bar' ,
2703
- floor : 1 ,
2704
- perBuyerTimeout : {
2705
- 'buyer1' : 100 ,
2706
- 'buyer2' : 200
2707
- } ,
2708
- perBuyerGroupLimits : {
2709
- 'buyer1' : 300 ,
2710
- 'buyer2' : 400
2711
- } ,
2712
- } ,
2713
- sellerCurrency : '???'
2714
- } ,
2692
+ impid : 'test-bidId-2' ,
2693
+ config : auctionConfig2 ,
2715
2694
} ) ;
2716
2695
} ) ;
2717
2696
0 commit comments