Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adt new alias #6004

Merged
merged 5 commits into from
Dec 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions modules/adtelligentBidAdapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,23 @@ const HOST_GETTERS = {
default: (function () {
let num = 0;
return function () {
return 'ghb' + subdomainSuffixes[num++ % subdomainSuffixes.length] + '.adtelligent.com'
return 'ghb' + subdomainSuffixes[num++ % subdomainSuffixes.length] + '.adtelligent.com';
}
}()),
appaloosa: function () {
return 'hb.appaloosa.media'
return 'ghb.hb.appaloosa.media';
},
onefiftytwomedia: function() {
return 'ghb.ads.152media.com';
},
mediafuse: function() {
return 'ghb.hbmp.mediafuse.com';
}

}
const getUri = function (bidderCode) {
let getter = HOST_GETTERS[bidderCode] || HOST_GETTERS['default'];
let bidderWithoutSuffix = bidderCode.split('_')[0];
let getter = HOST_GETTERS[bidderWithoutSuffix] || HOST_GETTERS['default'];
return PROTOCOL + getter() + AUCTION_PATH
}
const OUTSTREAM_SRC = 'https://player.adtelligent.com/outstream-unit/2.01/outstream.min.js';
Expand All @@ -32,7 +40,7 @@ const syncsCache = {};
export const spec = {
code: BIDDER_CODE,
gvlid: 410,
aliases: ['onefiftytwomedia', 'selectmedia', 'appaloosa'],
aliases: ['onefiftytwomedia', 'selectmedia', 'appaloosa', 'mediafuse'],
supportedMediaTypes: [VIDEO, BANNER],
isBidRequestValid: function (bid) {
return !!utils.deepAccess(bid, 'params.aid');
Expand Down
17 changes: 11 additions & 6 deletions test/spec/modules/adtelligentBidAdapter_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,13 @@ const EXPECTED_ENDPOINTS = [
'https://ghb.adtelligent.com/v2/auction/'
];
const aliasEP = {
appaloosa: 'https://hb.appaloosa.media/v2/auction/'
appaloosa: 'https://ghb.hb.appaloosa.media/v2/auction/',
appaloosa_publisherSuffix: 'https://ghb.hb.appaloosa.media/v2/auction/',
onefiftytwomedia: 'https://ghb.ads.152media.com/v2/auction/',
mediafuse: 'https://ghb.hbmp.mediafuse.com/v2/auction/'
};

const DEFAULT_ADATPER_REQ = { bidderCode: 'adtelligent' };
const DISPLAY_REQUEST = {
'bidder': 'adtelligent',
'params': {
Expand Down Expand Up @@ -244,10 +249,10 @@ describe('adtelligentBidAdapter', () => {
let videoBidRequests = [VIDEO_REQUEST];
let displayBidRequests = [DISPLAY_REQUEST];
let videoAndDisplayBidRequests = [DISPLAY_REQUEST, VIDEO_REQUEST];
const displayRequest = spec.buildRequests(displayBidRequests, {});
const videoRequest = spec.buildRequests(videoBidRequests, {});
const videoAndDisplayRequests = spec.buildRequests(videoAndDisplayBidRequests, {});
const rotatingRequest = spec.buildRequests(displayBidRequests, {});
const displayRequest = spec.buildRequests(displayBidRequests, DEFAULT_ADATPER_REQ);
const videoRequest = spec.buildRequests(videoBidRequests, DEFAULT_ADATPER_REQ);
const videoAndDisplayRequests = spec.buildRequests(videoAndDisplayBidRequests, DEFAULT_ADATPER_REQ);
const rotatingRequest = spec.buildRequests(displayBidRequests, DEFAULT_ADATPER_REQ);
it('rotates endpoints', () => {
const bidReqUrls = [displayRequest[0], videoRequest[0], videoAndDisplayRequests[0], rotatingRequest[0]].map(br => br.url);
expect(bidReqUrls).to.deep.equal(EXPECTED_ENDPOINTS);
Expand Down Expand Up @@ -276,7 +281,7 @@ describe('adtelligentBidAdapter', () => {
expect(videoAndDisplayRequests.every(comparator)).to.be.true;
});
it('forms correct ADPOD request', () => {
const pbBidReqData = spec.buildRequests([ADPOD_REQUEST], {})[0].data;
const pbBidReqData = spec.buildRequests([ADPOD_REQUEST], DEFAULT_ADATPER_REQ)[0].data;
const impRequest = pbBidReqData.BidRequests[0]
expect(impRequest.AdType).to.be.equal('video');
expect(impRequest.Adpod).to.be.a('object');
Expand Down