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

Renaming of "huddledmasses" adapter into colossusssp #1701

Merged
merged 1 commit into from
Oct 17, 2017
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
4 changes: 2 additions & 2 deletions integrationExamples/gpt/pbjs_example_gpt.html
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@
}
},
{
bidder: 'huddledmasses',
bidder: 'colossusssp',
params: {
placement_id: 0
}
Expand Down Expand Up @@ -384,7 +384,7 @@
}
},
{
bidder: 'huddledmasses',
bidder: 'colossusssp',
params: {
placement_id: 0
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {ajax} from 'src/ajax';
import {STATUS} from 'src/constants';
import adaptermanager from 'src/adaptermanager';

var BIDDER_CODE = 'huddledmasses';
var BIDDER_CODE = 'colossusssp';

var sizeObj = {
1: '468x60',
Expand Down Expand Up @@ -39,7 +39,7 @@ var sizeObj = {

utils._each(sizeObj, (item, key) => sizeObj[item] = key);

function HuddledMassesAdapter() {
function ColossusSspAdapter() {
function _callBids(bidderRequest) {
var bids = bidderRequest.bids || [];

Expand All @@ -50,9 +50,9 @@ function HuddledMassesAdapter() {
handleRpCB(responseText, bid);
} catch (err) {
if (typeof err === 'string') {
utils.logWarn(`${err} when processing huddledmasses response for placement code ${bid.placementCode}`);
utils.logWarn(`${err} when processing colossus response for placement code ${bid.placementCode}`);
} else {
utils.logError('Error processing huddledmasses response for placement code ' + bid.placementCode, null, err);
utils.logError('Error processing colossus response for placement code ' + bid.placementCode, null, err);
}
var badBid = bidfactory.createBid(STATUS.NO_BID, bid);
badBid.bidderCode = bid.bidder;
Expand All @@ -64,15 +64,15 @@ function HuddledMassesAdapter() {
try {
ajax(buildOptimizedCall(bid), bidCallback, undefined, { withCredentials: true });
} catch (err) {
utils.logError('Error sending huddledmasses request for placement code ' + bid.placementCode, null, err);
utils.logError('Error sending colossus request for placement code ' + bid.placementCode, null, err);
}
});
}

function buildOptimizedCall(bid) {
bid.startTime = (new Date()).getTime();

var parsedSizes = HuddledMassesAdapter.masSizeOrdering(
var parsedSizes = ColossusSspAdapter.masSizeOrdering(
Array.isArray(bid.params.sizes) ? bid.params.sizes.map(size => (sizeObj[size] || '').split('x')) : bid.sizes
);

Expand Down Expand Up @@ -117,7 +117,7 @@ function HuddledMassesAdapter() {
index % 2 === 0 && queryString[index + 1] !== undefined
? memo + curr + '=' + encodeURIComponent(queryString[index + 1]) + '&'
: memo,
'//huddledmassessupply.com/?'
'//colossusssp.com/?'
).slice(0, -1);
}

Expand All @@ -136,12 +136,12 @@ function HuddledMassesAdapter() {
bidmanager.addBidResponse(bidRequest.placementCode, bid);
}

return Object.assign(new Adapter(BIDDER_CODE), { // BIDDER_CODE huddledmasses
return Object.assign(new Adapter(BIDDER_CODE), { // BIDDER_CODE colossusssp
callBids: _callBids
});
}

HuddledMassesAdapter.masSizeOrdering = function (sizes) {
ColossusSspAdapter.masSizeOrdering = function (sizes) {
var MAS_SIZE_PRIORITY = [15, 2, 9];
return utils.parseSizesInput(sizes)
.reduce((result, size) => {
Expand Down Expand Up @@ -169,6 +169,6 @@ HuddledMassesAdapter.masSizeOrdering = function (sizes) {
});
};

adaptermanager.registerBidAdapter(new HuddledMassesAdapter(), 'huddledmasses');
adaptermanager.registerBidAdapter(new ColossusSspAdapter(), BIDDER_CODE);

module.exports = HuddledMassesAdapter;
module.exports = ColossusSspAdapter;
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { expect } from 'chai';
import Adapter from '../../../modules/huddledmassesBidAdapter';
import Adapter from '../../../modules/colossussspBidAdapter';
import adapterManager from 'src/adaptermanager';
import bidManager from 'src/bidmanager';
import CONSTANTS from 'src/constants.json';

describe('HuddledMasses adapter tests', function () {
describe('ColossusSSP adapter tests', function () {
let sandbox;
const adUnit = {
code: 'huddledmasses',
code: 'colossusssp',
sizes: [[300, 250], [300, 600]],
bids: [{
bidder: 'huddledmasses',
bidder: 'colossusssp',
params: {
placement_id: 0
}
Expand All @@ -34,7 +34,7 @@ describe('HuddledMasses adapter tests', function () {
sandbox.restore();
});

describe('HuddledMasses callBids validation', () => {
describe('ColossusSSP callBids validation', () => {
let bids,
server;

Expand All @@ -50,7 +50,7 @@ describe('HuddledMasses adapter tests', function () {
server.restore();
});

let adapter = adapterManager.bidderRegistry['huddledmasses'];
let adapter = adapterManager.bidderRegistry['colossusssp'];

it('Valid bid-request', () => {
sandbox.stub(adapter, 'callBids');
Expand All @@ -65,7 +65,7 @@ describe('HuddledMasses adapter tests', function () {
.with.lengthOf(1);

expect(bidderRequest).to.have.deep.property('bids[0]')
.to.have.property('bidder', 'huddledmasses');
.to.have.property('bidder', 'colossusssp');

expect(bidderRequest).to.have.deep.property('bids[0]')
.with.property('sizes')
Expand All @@ -88,7 +88,7 @@ describe('HuddledMasses adapter tests', function () {

expect(bids).to.be.lengthOf(1);
expect(bids[0].getStatusCode()).to.equal(CONSTANTS.STATUS.GOOD);
expect(bids[0].bidderCode).to.equal('huddledmasses');
expect(bids[0].bidderCode).to.equal('colossusssp');
expect(bids[0].width).to.equal(300);
expect(bids[0].height).to.equal(250);
expect(bids[0].cpm).to.equal(0.712);
Expand Down