diff --git a/modules/appnexusAstBidAdapter.js b/modules/appnexusBidAdapter.js similarity index 98% rename from modules/appnexusAstBidAdapter.js rename to modules/appnexusBidAdapter.js index 8d35e135097..92d5f6ba1ba 100644 --- a/modules/appnexusAstBidAdapter.js +++ b/modules/appnexusBidAdapter.js @@ -3,7 +3,7 @@ import * as utils from 'src/utils'; import { registerBidder } from 'src/adapters/bidderFactory'; import { NATIVE, VIDEO } from 'src/mediaTypes'; -const BIDDER_CODE = 'appnexusAst'; +const BIDDER_CODE = 'appnexus'; const URL = '//ib.adnxs.com/ut/v3/prebid'; const SUPPORTED_AD_TYPES = ['banner', 'video', 'native']; const VIDEO_TARGETING = ['id', 'mimes', 'minduration', 'maxduration', @@ -28,7 +28,7 @@ const SOURCE = 'pbjs'; export const spec = { code: BIDDER_CODE, - aliases: ['brealtime', 'pagescience', 'defymedia', 'gourmetads', 'matomy', 'featureforward', 'oftmedia'], + aliases: ['appnexusAst', 'brealtime', 'pagescience', 'defymedia', 'gourmetads', 'matomy', 'featureforward', 'oftmedia'], supportedMediaTypes: [VIDEO, NATIVE], /** diff --git a/modules/appnexusAstBidAdapter.md b/modules/appnexusBidAdapter.md similarity index 87% rename from modules/appnexusAstBidAdapter.md rename to modules/appnexusBidAdapter.md index 2b370e11616..58f260cdfc8 100644 --- a/modules/appnexusAstBidAdapter.md +++ b/modules/appnexusBidAdapter.md @@ -1,7 +1,7 @@ # Overview ``` -Module Name: AppnexusAst Bid Adapter +Module Name: Appnexus Bid Adapter Module Type: Bidder Adapter Maintainer: info@prebid.org ``` @@ -10,7 +10,7 @@ Maintainer: info@prebid.org Connects to Appnexus exchange for bids. -AppnexusAst bid adapter supports Banner, Video (instream and outstream) and Native. +Appnexus bid adapter supports Banner, Video (instream and outstream) and Native. # Test Parameters ``` @@ -20,7 +20,7 @@ var adUnits = [ code: 'banner-div', sizes: [[300, 250], [300,600]], bids: [{ - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '10433394' } @@ -51,7 +51,7 @@ var adUnits = [ } }, bids: [{ - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '9880618' } @@ -67,7 +67,7 @@ var adUnits = [ }, }, bids: [{ - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '9333431', video: { @@ -88,7 +88,7 @@ var adUnits = [ }, bids: [ { - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '5768085', video: { diff --git a/test/fixtures/video/adUnit.json b/test/fixtures/video/adUnit.json index 6d2b7c385ad..df55eb25d79 100644 --- a/test/fixtures/video/adUnit.json +++ b/test/fixtures/video/adUnit.json @@ -4,7 +4,7 @@ "mediaType": "video", "bids": [ { - "bidder": "appnexusAst", + "bidder": "appnexus", "params": { "placementId": "9333431", "video": { diff --git a/test/fixtures/video/bidRequest.json b/test/fixtures/video/bidRequest.json index 75f054611c4..f8306e27662 100644 --- a/test/fixtures/video/bidRequest.json +++ b/test/fixtures/video/bidRequest.json @@ -1,10 +1,10 @@ { "auctionStart": 1462918897459, - "bidderCode": "appnexusAst", + "bidderCode": "appnexus", "bidderRequestId": "2946b569352ef2", "bids": [ { - "bidder": "appnexusAst", + "bidder": "appnexus", "params": { "placementId": "9333431", "video": { diff --git a/test/fixtures/video/vastPayloadResponse.json b/test/fixtures/video/vastPayloadResponse.json index 9b621c21d30..7c388de41ed 100644 --- a/test/fixtures/video/vastPayloadResponse.json +++ b/test/fixtures/video/vastPayloadResponse.json @@ -1,8 +1,8 @@ { "adUnitCode": "video1", - "bidder": "appnexusAst", - "bidderCode": "appnexusAst", - "code": "appnexusAst", + "bidder": "appnexus", + "bidderCode": "appnexus", + "code": "appnexus", "dealId": "foo", "cpm": 0.1, "height": 480, diff --git a/test/fixtures/video/vastUrlResponse.json b/test/fixtures/video/vastUrlResponse.json index cba0798251d..f3b023dc7bb 100644 --- a/test/fixtures/video/vastUrlResponse.json +++ b/test/fixtures/video/vastUrlResponse.json @@ -1,8 +1,8 @@ { "adUnitCode": "video1", - "bidder": "appnexusAst", - "bidderCode": "appnexusAst", - "code": "appnexusAst", + "bidder": "appnexus", + "bidderCode": "appnexus", + "code": "appnexus", "dealId": "foo", "cpm": 0.1, "height": 480, diff --git a/test/pages/video.html b/test/pages/video.html index 8d28650cbfc..c6a72b6e26b 100644 --- a/test/pages/video.html +++ b/test/pages/video.html @@ -36,7 +36,7 @@ }, bids: [ { - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '9333431', video: { diff --git a/test/spec/e2e/gpt-examples/gpt_outstream.html b/test/spec/e2e/gpt-examples/gpt_outstream.html index 2230248886b..42ba48c98e7 100644 --- a/test/spec/e2e/gpt-examples/gpt_outstream.html +++ b/test/spec/e2e/gpt-examples/gpt_outstream.html @@ -45,7 +45,7 @@ mediaType: 'video-outstream', bids: [ { - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '5768085', video: { @@ -62,7 +62,7 @@ mediaType: 'video-outstream', bids: [ { - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '5768085', video: { diff --git a/test/spec/modules/appnexusAstBidAdapter_spec.js b/test/spec/modules/appnexusBidAdapter_spec.js similarity index 98% rename from test/spec/modules/appnexusAstBidAdapter_spec.js rename to test/spec/modules/appnexusBidAdapter_spec.js index 3884b1c5863..fcb8bfdfb99 100644 --- a/test/spec/modules/appnexusAstBidAdapter_spec.js +++ b/test/spec/modules/appnexusBidAdapter_spec.js @@ -1,5 +1,5 @@ import { expect } from 'chai'; -import { spec } from 'modules/appnexusAstBidAdapter'; +import { spec } from 'modules/appnexusBidAdapter'; import { newBidder } from 'src/adapters/bidderFactory'; const ENDPOINT = '//ib.adnxs.com/ut/v3/prebid'; @@ -15,7 +15,7 @@ describe('AppNexusAdapter', () => { describe('isBidRequestValid', () => { let bid = { - 'bidder': 'appnexusAst', + 'bidder': 'appnexus', 'params': { 'placementId': '10433394' }, @@ -54,7 +54,7 @@ describe('AppNexusAdapter', () => { describe('buildRequests', () => { let bidRequests = [ { - 'bidder': 'appnexusAst', + 'bidder': 'appnexus', 'params': { 'placementId': '10433394' }, diff --git a/test/spec/unit/core/adapterManager_spec.js b/test/spec/unit/core/adapterManager_spec.js index 8b5f0f714b4..ae09d8598bb 100644 --- a/test/spec/unit/core/adapterManager_spec.js +++ b/test/spec/unit/core/adapterManager_spec.js @@ -53,7 +53,7 @@ describe('adapterManager tests', () => { 'tid': '34566b569352ef2', 'bids': [ { - 'bidder': 'appnexusAst', + 'bidder': 'appnexus', 'params': { 'placementId': '4799418', 'test': 'me' @@ -87,7 +87,7 @@ describe('adapterManager tests', () => { const adUnits = [{ code: 'adUnit-code', bids: [ - {bidder: 'appnexusAst', params: {placementId: 'id'}}, + {bidder: 'appnexus', params: {placementId: 'id'}}, {bidder: 'fakeBidder', params: {placementId: 'id'}} ] }]; diff --git a/test/spec/unit/pbjs_api_spec.js b/test/spec/unit/pbjs_api_spec.js index 613074e59f9..7785bc1801b 100644 --- a/test/spec/unit/pbjs_api_spec.js +++ b/test/spec/unit/pbjs_api_spec.js @@ -12,6 +12,7 @@ import { targeting, newTargeting } from 'src/targeting'; import { config as configObj } from 'src/config'; import * as ajaxLib from 'src/ajax'; import * as auctionModule from 'src/auction'; +import { registerBidder } from 'src/adapters/bidderFactory'; var assert = require('chai').assert; var expect = require('chai').expect; @@ -29,7 +30,7 @@ var adserver = require('src/adserver'); var CONSTANTS = require('src/constants.json'); // These bid adapters are required to be loaded for the following tests to work -require('modules/appnexusAstBidAdapter'); +require('modules/appnexusBidAdapter'); var config = require('test/fixtures/config.json'); @@ -410,12 +411,12 @@ describe('Unit: Prebid Module', function () { currentPriceBucket = configObj.getConfig('priceGranularity'); configObj.setConfig({ priceGranularity: customConfigObject }); sinon.stub(adaptermanager, 'makeBidRequests', () => ([{ - 'bidderCode': 'appnexusAst', + 'bidderCode': 'appnexus', 'auctionId': '20882439e3238c', 'bidderRequestId': '331f3cf3f1d9c8', 'bids': [ { - 'bidder': 'appnexusAst', + 'bidder': 'appnexus', 'params': { 'placementId': '10433394' }, @@ -451,7 +452,7 @@ describe('Unit: Prebid Module', function () { code: 'div-gpt-ad-1460505748561-0', sizes: [[300, 250], [300, 600]], bids: [{ - bidder: 'appnexusAst', + bidder: 'appnexus', params: { placementId: '10433394' } @@ -818,6 +819,15 @@ describe('Unit: Prebid Module', function () { var auctionManagerStub; let logMessageSpy + let spec = { + code: 'sampleBidder', + isBidRequestValid: () => {}, + buildRequests: () => {}, + interpretResponse: () => {}, + getUserSyncs: () => {} + }; + registerBidder(spec); + describe('part 1', () => { beforeEach(() => { adUnitsBackup = auction.getAdUnits @@ -901,7 +911,7 @@ describe('Unit: Prebid Module', function () { sizes: [[300, 250], [300, 600]], bids: [ {bidder: 'appnexus', params: {placementId: 'id'}}, - {bidder: 'appnexusAst', params: {placementId: 'id'}} + {bidder: 'sampleBidder', params: {placementId: 'id'}} ] }]; adUnitCodes = ['adUnit-code']; @@ -909,7 +919,7 @@ describe('Unit: Prebid Module', function () { spyCallBids = sinon.spy(adaptermanager, 'callBids'); createAuctionStub = sinon.stub(auctionModule, 'newAuction'); createAuctionStub.returns(auction); - }) + }); after(() => { auctionModule.newAuction.restore(); @@ -918,7 +928,7 @@ describe('Unit: Prebid Module', function () { it('should not callBids if a video adUnit has non-video bidders', () => { const videoAdaptersBackup = adaptermanager.videoAdapters; - adaptermanager.videoAdapters = ['appnexusAst']; + adaptermanager.videoAdapters = ['appnexus']; $$PREBID_GLOBAL$$.requestBids({adUnits}); sinon.assert.notCalled(adaptermanager.callBids); adaptermanager.videoAdapters = videoAdaptersBackup; @@ -936,7 +946,7 @@ describe('Unit: Prebid Module', function () { mediaType: 'video', sizes: [[300, 250], [300, 600]], bids: [ - {bidder: 'appnexusAst', params: {placementId: 'id'}} + {bidder: 'appnexus', params: {placementId: 'id'}} ] }]; adUnitCodes = ['adUnit-code']; @@ -953,7 +963,7 @@ describe('Unit: Prebid Module', function () { it('should callBids if a video adUnit has all video bidders', () => { const videoAdaptersBackup = adaptermanager.videoAdapters; - adaptermanager.videoAdapters = ['appnexusAst']; + adaptermanager.videoAdapters = ['appnexus']; $$PREBID_GLOBAL$$.requestBids({adUnits}); sinon.assert.calledOnce(adaptermanager.callBids); adaptermanager.videoAdapters = videoAdaptersBackup; @@ -972,7 +982,7 @@ describe('Unit: Prebid Module', function () { sizes: [[300, 250], [300, 600]], bids: [ {bidder: 'appnexus', params: {placementId: 'id'}}, - {bidder: 'appnexusAst', params: {placementId: 'id'}} + {bidder: 'sampleBidder', params: {placementId: 'id'}} ] }]; adUnitCodes = ['adUnit-code']; @@ -980,7 +990,7 @@ describe('Unit: Prebid Module', function () { spyCallBids = sinon.spy(adaptermanager, 'callBids'); createAuctionStub = sinon.stub(auctionModule, 'newAuction'); createAuctionStub.returns(auction); - }) + }); after(() => { auctionModule.newAuction.restore(); @@ -988,7 +998,7 @@ describe('Unit: Prebid Module', function () { }); it('should only request native bidders on native adunits', () => { - // appnexusAst is a native bidder, appnexus is not + // appnexus is a native bidder, appnexus is not $$PREBID_GLOBAL$$.requestBids({adUnits}); sinon.assert.calledOnce(adaptermanager.callBids); const spyArgs = adaptermanager.callBids.getCall(0); @@ -1007,7 +1017,7 @@ describe('Unit: Prebid Module', function () { code: 'adUnit-code', sizes: [[300, 250], [300, 600]], bids: [ - {bidder: 'appnexusAst', params: {placementId: '10433394'}} + {bidder: 'appnexus', params: {placementId: '10433394'}} ] }]; let adUnitCodes = ['adUnit-code']; @@ -1022,7 +1032,7 @@ describe('Unit: Prebid Module', function () { nativeParams: {type: 'image'}, sizes: [[300, 250], [300, 600]], bids: [ - {bidder: 'appnexusAst', params: {placementId: 'id'}} + {bidder: 'appnexus', params: {placementId: 'id'}} ] }]; let auction3 = auctionModule.newAuction({adUnits, adUnitCodes, callback: function() {}, cbTimeout: timeout}); @@ -1046,7 +1056,6 @@ describe('Unit: Prebid Module', function () { }) it('should callBids if a native adUnit has all native bidders', () => { - // TODO: appnexusAst is currently hardcoded in native.js, update this text when fixed $$PREBID_GLOBAL$$.requestBids({adUnits}); sinon.assert.calledOnce(adaptermanager.callBids); }); @@ -1056,7 +1065,7 @@ describe('Unit: Prebid Module', function () { code: 'adUnit-code', sizes: [[300, 250], [300, 600]], bids: [ - {bidder: 'appnexusAst', params: {placementId: '10433394'}} + {bidder: 'appnexus', params: {placementId: '10433394'}} ] }]; $$PREBID_GLOBAL$$.requestBids({adUnits}); @@ -1069,7 +1078,7 @@ describe('Unit: Prebid Module', function () { nativeParams: {type: 'image'}, sizes: [[300, 250], [300, 600]], bids: [ - {bidder: 'appnexusAst', params: {placementId: 'id'}} + {bidder: 'appnexus', params: {placementId: 'id'}} ] }]; $$PREBID_GLOBAL$$.requestBids({adUnits}); diff --git a/test/spec/video_spec.js b/test/spec/video_spec.js index 857353a43a4..e2ae44491ee 100644 --- a/test/spec/video_spec.js +++ b/test/spec/video_spec.js @@ -11,7 +11,7 @@ describe('video.js', () => { const bidRequests = [{ bids: [{ bidId: '123abc', - bidder: 'appnexusAst', + bidder: 'appnexus', mediaTypes: { video: { context: 'instream' } } @@ -28,7 +28,7 @@ describe('video.js', () => { const bidRequests = [{ bids: [{ bidId: '123abc', - bidder: 'appnexusAst', + bidder: 'appnexus', mediaTypes: { video: { context: 'instream' } } @@ -65,7 +65,7 @@ describe('video.js', () => { const bidRequests = [{ bids: [{ bidId: '123abc', - bidder: 'appnexusAst', + bidder: 'appnexus', mediaTypes: { video: { context: 'outstream' } } @@ -82,7 +82,7 @@ describe('video.js', () => { const bidRequests = [{ bids: [{ bidId: '123abc', - bidder: 'appnexusAst', + bidder: 'appnexus', mediaTypes: { video: { context: 'outstream' } }