Skip to content

Commit

Permalink
Pubmatic: Contribute vendor details for Prebid server adapter (#10706)
Browse files Browse the repository at this point in the history
* Adding config for openwrap metadapter

* Changed from http to https and timeout to 500

* Timeout value update
  • Loading branch information
pm-priyanka-deshmane authored Nov 9, 2023
1 parent 7ecec48 commit 6667f33
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
9 changes: 9 additions & 0 deletions modules/prebidServerBidAdapter/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,14 @@ export const S2S_VENDORS = {
noP1Consent: 'https://prebid.openx.net/cookie_sync'
},
timeout: 1000
},
'openwrap': {
adapter: 'prebidServer',
enabled: true,
endpoint: {
p1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs',
noP1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs'
},
timeout: 500
}
}
68 changes: 68 additions & 0 deletions test/spec/modules/prebidServerBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3764,6 +3764,74 @@ describe('S2S Adapter', function () {
})
});

it('should configure the s2sConfig object with openwrap vendor defaults unless specified by user', function () {
const options = {
accountId: '1234',
bidders: ['pubmatic'],
defaultVendor: 'openwrap'
};

config.setConfig({ s2sConfig: options });
sinon.assert.notCalled(logErrorSpy);

let vendorConfig = config.getConfig('s2sConfig');
expect(vendorConfig).to.have.property('accountId', '1234');
expect(vendorConfig).to.have.property('adapter', 'prebidServer');
expect(vendorConfig.bidders).to.deep.equal(['pubmatic']);
expect(vendorConfig.enabled).to.be.true;
expect(vendorConfig.endpoint).to.deep.equal({
p1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs',
noP1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs'
});
expect(vendorConfig).to.have.property('timeout', 500);
});

it('should return proper defaults', function () {
const options = {
accountId: '1234',
bidders: ['pubmatic'],
defaultVendor: 'openwrap',
timeout: 500
};

config.setConfig({ s2sConfig: options });
expect(config.getConfig('s2sConfig')).to.deep.equal({
'accountId': '1234',
'adapter': 'prebidServer',
'bidders': ['pubmatic'],
'defaultVendor': 'openwrap',
'enabled': true,
'endpoint': {
p1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs',
noP1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs'
},
'timeout': 500
})
});

it('should return default adapterOptions if not set', function () {
config.setConfig({
s2sConfig: {
accountId: '1234',
bidders: ['pubmatic'],
defaultVendor: 'openwrap',
timeout: 500
}
});
expect(config.getConfig('s2sConfig')).to.deep.equal({
enabled: true,
timeout: 500,
adapter: 'prebidServer',
accountId: '1234',
bidders: ['pubmatic'],
defaultVendor: 'openwrap',
endpoint: {
p1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs',
noP1Consent: 'https://ow.pubmatic.com/openrtb2/auction?source=pbjs'
},
})
});

it('should set adapterOptions', function () {
config.setConfig({
s2sConfig: {
Expand Down

0 comments on commit 6667f33

Please sign in to comment.