-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fdf273
commit c5c59f3
Showing
4 changed files
with
223 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
251 changes: 3 additions & 248 deletions
251
test/integrations/destinations/the_trade_desk/delivery/data.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,248 +1,3 @@ | ||
import { | ||
destType, | ||
destTypeInUpperCase, | ||
advertiserId, | ||
dataProviderId, | ||
segmentName, | ||
sampleDestination, | ||
} from '../common'; | ||
|
||
beforeAll(() => { | ||
process.env.THE_TRADE_DESK_DATA_PROVIDER_SECRET_KEY = 'mockedDataProviderSecretKey'; | ||
}); | ||
|
||
afterAll(() => { | ||
delete process.env.THE_TRADE_DESK_DATA_PROVIDER_SECRET_KEY; | ||
}); | ||
|
||
export const data = [ | ||
{ | ||
name: destType, | ||
description: 'Successful delivery of Add/Remove IDs to/from Trade Desk', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: 'https://sin-data.adsrvr.org/data/advertiser', | ||
headers: {}, | ||
params: {}, | ||
destinationConfig: sampleDestination.Config, | ||
body: { | ||
JSON: { | ||
AdvertiserId: advertiserId, | ||
DataProviderId: dataProviderId, | ||
Items: [ | ||
{ | ||
DAID: 'test-daid-1', | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 43200, | ||
}, | ||
], | ||
}, | ||
{ | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 43200, | ||
}, | ||
], | ||
UID2: 'test-uid2-1', | ||
}, | ||
{ | ||
DAID: 'test-daid-2', | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 0, | ||
}, | ||
], | ||
}, | ||
{ | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 0, | ||
}, | ||
], | ||
UID2: 'test-uid2-2', | ||
}, | ||
], | ||
}, | ||
JSON_ARRAY: {}, | ||
XML: {}, | ||
FORM: {}, | ||
}, | ||
files: {}, | ||
userId: '', | ||
}, | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
destinationResponse: { | ||
response: {}, | ||
status: 200, | ||
}, | ||
message: 'Request Processed Successfully', | ||
status: 200, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: destType, | ||
description: 'Error response from The Trade Desk due to invalid IDs', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: 'https://sin-data.adsrvr.org/data/advertiser', | ||
headers: {}, | ||
params: {}, | ||
destinationConfig: sampleDestination.Config, | ||
body: { | ||
JSON: { | ||
AdvertiserId: advertiserId, | ||
DataProviderId: dataProviderId, | ||
Items: [ | ||
{ | ||
DAID: 'test-daid', | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 43200, | ||
}, | ||
], | ||
}, | ||
{ | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 43200, | ||
}, | ||
], | ||
UID2: 'test-invalid-uid2', | ||
}, | ||
], | ||
}, | ||
JSON_ARRAY: {}, | ||
XML: {}, | ||
FORM: {}, | ||
}, | ||
files: {}, | ||
userId: '', | ||
}, | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 400, | ||
body: { | ||
output: { | ||
destinationResponse: { | ||
response: { | ||
FailedLines: [{ ErrorCode: 'MissingUserId', Message: 'Invalid UID2, item #2' }], | ||
}, | ||
status: 200, | ||
}, | ||
message: | ||
'Request failed with status: 200 due to {"FailedLines":[{"ErrorCode":"MissingUserId","Message":"Invalid UID2, item #2"}]}', | ||
statTags: { | ||
destType: destTypeInUpperCase, | ||
destinationId: 'Non-determininable', | ||
errorCategory: 'network', | ||
errorType: 'aborted', | ||
feature: 'dataDelivery', | ||
implementation: 'native', | ||
module: 'destination', | ||
workspaceId: 'Non-determininable', | ||
}, | ||
status: 400, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: destType, | ||
description: | ||
'Missing advertiser secret key in destination config from proxy request from server', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v0', | ||
input: { | ||
request: { | ||
body: { | ||
version: '1', | ||
type: 'REST', | ||
method: 'POST', | ||
endpoint: 'https://sin-data.adsrvr.org/data/advertiser', | ||
headers: {}, | ||
params: {}, | ||
body: { | ||
JSON: { | ||
AdvertiserId: advertiserId, | ||
DataProviderId: dataProviderId, | ||
Items: [ | ||
{ | ||
DAID: 'test-daid-1', | ||
Data: [ | ||
{ | ||
Name: segmentName, | ||
TTLInMinutes: 43200, | ||
}, | ||
], | ||
}, | ||
], | ||
}, | ||
JSON_ARRAY: {}, | ||
XML: {}, | ||
FORM: {}, | ||
}, | ||
files: {}, | ||
userId: '', | ||
}, | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 400, | ||
body: { | ||
output: { | ||
destinationResponse: '', | ||
message: 'Advertiser secret key is missing in destination config. Aborting', | ||
statTags: { | ||
destType: destTypeInUpperCase, | ||
destinationId: 'Non-determininable', | ||
errorCategory: 'platform', | ||
feature: 'dataDelivery', | ||
implementation: 'native', | ||
module: 'destination', | ||
workspaceId: 'Non-determininable', | ||
}, | ||
status: 400, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
]; | ||
import { businessProxyV1 } from './business'; | ||
import { otherProxyV1 } from './other'; | ||
export const data = [...businessProxyV1, ...otherProxyV1]; |
Oops, something went wrong.