diff --git a/modules/admaticBidAdapter.js b/modules/admaticBidAdapter.js index f2b717a0367..9f2e8b1943e 100644 --- a/modules/admaticBidAdapter.js +++ b/modules/admaticBidAdapter.js @@ -57,7 +57,8 @@ export const spec = { ext: { cur: currency, bidder: bidderName - } + }, + tmax: bidderRequest.timeout }; if (!isEmpty(blacklist.badv)) { @@ -132,7 +133,7 @@ export const spec = { function isUrl(str) { try { - new URL(str); + URL(str); return true; } catch (error) { return false; diff --git a/test/spec/modules/admaticBidAdapter_spec.js b/test/spec/modules/admaticBidAdapter_spec.js index 9bafcf0d33e..d100fc8e880 100644 --- a/test/spec/modules/admaticBidAdapter_spec.js +++ b/test/spec/modules/admaticBidAdapter_spec.js @@ -27,7 +27,8 @@ describe('admaticBidAdapter', () => { 'bidId': '30b31c1838de1e', 'bidderRequestId': '22edbae2733bf6', 'auctionId': '1d1a030790a475', - 'creativeId': 'er2ee' + 'creativeId': 'er2ee', + 'ortb2': { 'badv': ['admatic.com.tr'] } }; it('should return true when required params found', function() { @@ -51,6 +52,7 @@ describe('admaticBidAdapter', () => { 'networkId': 10433394, 'host': 'layer.serve.admatic.com.tr' }, + 'ortb2': { 'badv': ['admatic.com.tr'] }, 'mediaTypes': { 'banner': { 'sizes': [[300, 250], [728, 90]] @@ -104,6 +106,49 @@ describe('admaticBidAdapter', () => { '728x90': { 'currency': 'USD', 'floor': 2 } } } + }, + { + "size": [ + { + "w": 338, + "h": 280 + } + ], + "type": "video", + "mediatype": { + "context": "instream", + "mimes": [ + "video/mp4" + ], + "maxduration": 240, + "api": [ + 1, + 2 + ], + "playerSize": [ + [ + 338, + 280 + ] + ], + "protocols": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "skip": 1, + "playbackmethod": [ + 2 + ], + "linearity": 1, + "placement": 2 + }, + "id": "45e86fc7ce7fc93" } ], 'ext': { @@ -117,6 +162,7 @@ describe('admaticBidAdapter', () => { 'networkId': 10433394, 'host': 'layer.serve.admatic.com.tr' }, + 'ortb2': { 'badv': ['admatic.com.tr'] }, 'mediaTypes': { 'banner': { 'sizes': [[300, 250], [728, 90]] @@ -170,6 +216,49 @@ describe('admaticBidAdapter', () => { '728x90': { 'currency': 'USD', 'floor': 2 } } } + }, + { + "size": [ + { + "w": 338, + "h": 280 + } + ], + "type": "video", + "mediatype": { + "context": "instream", + "mimes": [ + "video/mp4" + ], + "maxduration": 240, + "api": [ + 1, + 2 + ], + "playerSize": [ + [ + 338, + 280 + ] + ], + "protocols": [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8 + ], + "skip": 1, + "playbackmethod": [ + 2 + ], + "linearity": 1, + "placement": 2 + }, + "id": "45e86fc7ce7fc93" } ], 'ext': { @@ -195,6 +284,7 @@ describe('admaticBidAdapter', () => { 'sizes': [[300, 250], [728, 90]] } }, + 'ortb2': { 'badv': ['admatic.com.tr'] }, getFloor: inputParams => { if (inputParams.mediaType === BANNER && inputParams.size[0] === 300 && inputParams.size[1] === 250) { return { @@ -218,6 +308,7 @@ describe('admaticBidAdapter', () => { 'networkId': 10433394, 'host': 'layer.serve.admatic.com.tr' }, + 'ortb2': { 'badv': ['admatic.com.tr'] }, 'adUnitCode': 'adunit-code', 'sizes': [[300, 250], [728, 90]], 'bidId': '30b31c1838de1e', @@ -254,8 +345,31 @@ describe('admaticBidAdapter', () => { 'bidder': 'admatic', 'adomain': ['admatic.com.tr'], 'party_tag': '
', - 'iurl': 'https://www.admatic.com.tr', - 'type': 'banner' + 'iurl': 'https://www.admatic.com.tr' + }, + { + 'id': 2, + 'creative_id': '3741', + 'width': 300, + 'height': 250, + 'price': 0.01, + 'type': 'video', + 'bidder': 'admatic', + 'adomain': ['admatic.com.tr'], + 'party_tag': '', + 'iurl': 'https://www.admatic.com.tr' + }, + { + 'id': 3, + 'creative_id': '3741', + 'width': 300, + 'height': 250, + 'price': 0.01, + 'type': 'video', + 'bidder': 'admatic', + 'adomain': ['admatic.com.tr'], + 'party_tag': 'https://www.admatic.com.tr', + 'iurl': 'https://www.admatic.com.tr' } ], 'queryId': 'cdnbh24rlv0hhkpfpln0', @@ -278,6 +392,40 @@ describe('admaticBidAdapter', () => { }, ttl: 60, bidder: 'admatic' + }, + { + requestId: 2, + cpm: 0.01, + width: 300, + height: 250, + currency: 'TRY', + mediaType: 'video', + netRevenue: true, + vastImpUrl: 'https://www.admatic.com.tr', + vastXml: '', + creativeId: '3741', + meta: { + advertiserDomains: ['admatic.com.tr'] + }, + ttl: 60, + bidder: 'admatic' + }, + { + requestId: 3, + cpm: 0.01, + width: 300, + height: 250, + currency: 'TRY', + mediaType: 'video', + netRevenue: true, + vastImpUrl: 'https://www.admatic.com.tr', + vastXml: 'https://www.admatic.com.tr', + creativeId: '3741', + meta: { + advertiserDomains: ['admatic.com.tr'] + }, + ttl: 60, + bidder: 'admatic' } ]; const request = {