From d02fee2e3f4938542cafd71093a3c78d8e93984a Mon Sep 17 00:00:00 2001 From: Bill Newman Date: Fri, 24 Sep 2021 16:38:56 +0300 Subject: [PATCH] Colossus Adapter: add pbAdSlot support (#7464) * add video&native traffic colossus ssp * Native obj validation * Native obj validation #2 * Added size field in requests * fixed test * fix merge conflicts * move to 3.0 * move to 3.0 * fix IE11 new URL issue * fix IE11 new URL issue * fix IE11 new URL issue * https for 3.0 * add https test * add ccp and schain features * fix test * sync with upstream, fix conflicts * Update colossussspBidAdapter.js remove commented code * Update colossussspBidAdapter.js lint fix * identity extensions * identity extensions * fix * fix * fix * fix * fix * add tests for user ids * fix * fix * fix * fix * fix * fix * fix * add gdpr support * add gdpr support * id5id support * Update colossussspBidAdapter.js add bidfloor parameter * Update colossussspBidAdapter.js check bidfloor * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter.js * Update colossussspBidAdapter_spec.js * use floor module * Revert "use floor module" This reverts commit f0c5c248627567e669d8eed4f2bb9a26a857e2ad. * use floor module * update to 5v * fix * add uid2 and bidFloor support * fix * add pbadslot support Co-authored-by: Vladislav Isaiko Co-authored-by: Aiholkin Co-authored-by: Mykhailo Yaremchuk --- modules/colossussspBidAdapter.js | 4 ++++ .../modules/colossussspBidAdapter_spec.js | 20 +++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/modules/colossussspBidAdapter.js b/modules/colossussspBidAdapter.js index 52865b8085d..b000cefd1b2 100644 --- a/modules/colossussspBidAdapter.js +++ b/modules/colossussspBidAdapter.js @@ -106,6 +106,10 @@ export const spec = { if (bid.schain) { placement.schain = bid.schain; } + let gpid = utils.deepAccess(bid, 'ortb2Imp.ext.data.pbadslot'); + if (gpid) { + placement.gpid = gpid; + } if (bid.userId) { getUserId(placement.eids, bid.userId.britepoolid, 'britepool.com'); getUserId(placement.eids, bid.userId.idl_env, 'identityLink'); diff --git a/test/spec/modules/colossussspBidAdapter_spec.js b/test/spec/modules/colossussspBidAdapter_spec.js index fa543f28fd1..0fe4d5b358e 100644 --- a/test/spec/modules/colossussspBidAdapter_spec.js +++ b/test/spec/modules/colossussspBidAdapter_spec.js @@ -1,5 +1,5 @@ -import {expect} from 'chai'; -import {spec} from '../../../modules/colossussspBidAdapter.js'; +import { expect } from 'chai'; +import { spec } from '../../../modules/colossussspBidAdapter.js'; describe('ColossussspAdapter', function () { let bid = { @@ -16,6 +16,13 @@ describe('ColossussspAdapter', function () { sizes: [[300, 250]] } }, + ortb2Imp: { + ext: { + data: { + pbadslot: '/19968336/prebid_cache_video_adunit' + } + } + }, transactionId: '3bb2f6da-87a6-4029-aeb0-bfe951372e62', schain: { ver: '1.0', @@ -71,7 +78,7 @@ describe('ColossussspAdapter', function () { it('Returns valid URL', function () { expect(serverRequest.url).to.equal('https://colossusssp.com/?c=o&m=multi'); }); - it('Should contain ccpa', function() { + it('Should contain ccpa', function () { expect(serverRequest.data.ccpa).to.be.an('string') }) @@ -88,13 +95,14 @@ describe('ColossussspAdapter', function () { let placements = data['placements']; for (let i = 0; i < placements.length; i++) { let placement = placements[i]; - expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor'); + expect(placement).to.have.all.keys('placementId', 'eids', 'bidId', 'traffic', 'sizes', 'schain', 'floor', 'gpid'); expect(placement.schain).to.be.an('object') expect(placement.placementId).to.be.a('number'); expect(placement.bidId).to.be.a('string'); expect(placement.traffic).to.be.a('string'); expect(placement.sizes).to.be.an('array'); expect(placement.floor).to.be.an('object'); + expect(placement.gpid).to.be.an('string'); } }); it('Returns empty data if no valid requests are passed', function () { @@ -135,7 +143,7 @@ describe('ColossussspAdapter', function () { describe('interpretResponse', function () { let resObject = { - body: [ { + body: [{ requestId: '123', mediaType: 'banner', cpm: 0.3, @@ -150,7 +158,7 @@ describe('ColossussspAdapter', function () { advertiserDomains: ['google.com'], advertiserId: 1234 } - } ] + }] }; let serverResponses = spec.interpretResponse(resObject); it('Returns an array of valid server responses if response object is valid', function () {