-
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
16ac116
commit 9357876
Showing
2 changed files
with
295 additions
and
1 deletion.
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
293 changes: 293 additions & 0 deletions
293
test/integrations/destinations/marketo/dataDelivery/other.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 |
---|---|---|
@@ -0,0 +1,293 @@ | ||
import { ProxyV1TestData } from '../../../testTypes'; | ||
import { generateProxyV1Payload } from '../../../testUtils'; | ||
|
||
export const otheMarketoScenariosV1: ProxyV1TestData[] = [ | ||
{ | ||
id: 'marketo_v1_other_scenario_1', | ||
name: 'marketo', | ||
description: | ||
'[Proxy v1 API] :: Scenario for testing Service Unavailable error from destination', | ||
successCriteria: 'Should return 503 status code with error message', | ||
scenario: 'Framework', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v1', | ||
input: { | ||
request: { | ||
body: generateProxyV1Payload({ | ||
endpoint: 'https://random_test_url/test_for_service_not_available', | ||
}), | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
response: [ | ||
{ | ||
error: | ||
'{"error":{"message":"Service Unavailable","description":"The server is currently unable to handle the request due to temporary overloading or maintenance of the server. Please try again later."}}', | ||
statusCode: 503, | ||
metadata: { | ||
jobId: 1, | ||
attemptNum: 1, | ||
userId: 'default-userId', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
sourceId: 'default-sourceId', | ||
secret: { | ||
accessToken: 'default-accessToken', | ||
}, | ||
dontBatch: false, | ||
}, | ||
}, | ||
], | ||
statTags: { | ||
errorCategory: 'network', | ||
errorType: 'retryable', | ||
destType: 'MARKETO', | ||
module: 'destination', | ||
implementation: 'native', | ||
feature: 'dataDelivery', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
}, | ||
message: 'Request failed with status: 503', | ||
status: 503, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
id: 'marketo_v1_other_scenario_2', | ||
name: 'marketo', | ||
description: '[Proxy v1 API] :: Scenario for testing Internal Server error from destination', | ||
successCriteria: 'Should return 500 status code with error message', | ||
scenario: 'Framework', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v1', | ||
input: { | ||
request: { | ||
body: generateProxyV1Payload({ | ||
endpoint: 'https://random_test_url/test_for_internal_server_error', | ||
}), | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
response: [ | ||
{ | ||
error: '"Internal Server Error"', | ||
statusCode: 500, | ||
metadata: { | ||
jobId: 1, | ||
attemptNum: 1, | ||
userId: 'default-userId', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
sourceId: 'default-sourceId', | ||
secret: { | ||
accessToken: 'default-accessToken', | ||
}, | ||
dontBatch: false, | ||
}, | ||
}, | ||
], | ||
statTags: { | ||
errorCategory: 'network', | ||
errorType: 'retryable', | ||
destType: 'MARKETO', | ||
module: 'destination', | ||
implementation: 'native', | ||
feature: 'dataDelivery', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
}, | ||
message: 'Request failed with status: 500', | ||
status: 500, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
id: 'marketo_v1_other_scenario_3', | ||
name: 'marketo', | ||
description: '[Proxy v1 API] :: Scenario for testing Gateway Time Out error from destination', | ||
successCriteria: 'Should return 504 status code with error message', | ||
scenario: 'Framework', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v1', | ||
input: { | ||
request: { | ||
body: generateProxyV1Payload({ | ||
endpoint: 'https://random_test_url/test_for_gateway_time_out', | ||
}), | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
response: [ | ||
{ | ||
error: '"Gateway Timeout"', | ||
statusCode: 504, | ||
metadata: { | ||
jobId: 1, | ||
attemptNum: 1, | ||
userId: 'default-userId', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
sourceId: 'default-sourceId', | ||
secret: { | ||
accessToken: 'default-accessToken', | ||
}, | ||
dontBatch: false, | ||
}, | ||
}, | ||
], | ||
statTags: { | ||
errorCategory: 'network', | ||
errorType: 'retryable', | ||
destType: 'MARKETO', | ||
module: 'destination', | ||
implementation: 'native', | ||
feature: 'dataDelivery', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
}, | ||
message: 'Request failed with status: 504', | ||
status: 504, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
id: 'marketo_v1_other_scenario_4', | ||
name: 'marketo', | ||
description: '[Proxy v1 API] :: Scenario for testing null response from destination', | ||
successCriteria: 'Should return 500 status code with empty error message', | ||
scenario: 'Framework', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v1', | ||
input: { | ||
request: { | ||
body: generateProxyV1Payload({ | ||
endpoint: 'https://random_test_url/test_for_null_response', | ||
}), | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
response: [ | ||
{ | ||
error: '""', | ||
statusCode: 500, | ||
metadata: { | ||
jobId: 1, | ||
attemptNum: 1, | ||
userId: 'default-userId', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
sourceId: 'default-sourceId', | ||
secret: { | ||
accessToken: 'default-accessToken', | ||
}, | ||
dontBatch: false, | ||
}, | ||
}, | ||
], | ||
statTags: { | ||
errorCategory: 'network', | ||
errorType: 'retryable', | ||
destType: 'MARKETO', | ||
module: 'destination', | ||
implementation: 'native', | ||
feature: 'dataDelivery', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
}, | ||
message: 'Request failed with status: 500', | ||
status: 500, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
id: 'marketo_v1_other_scenario_5', | ||
name: 'marketo', | ||
description: | ||
'[Proxy v1 API] :: Scenario for testing null and no status response from destination', | ||
successCriteria: 'Should return 500 status code with empty error message', | ||
scenario: 'Framework', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v1', | ||
input: { | ||
request: { | ||
body: generateProxyV1Payload({ | ||
endpoint: 'https://random_test_url/test_for_null_and_no_status', | ||
}), | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
response: [ | ||
{ | ||
error: '""', | ||
statusCode: 500, | ||
metadata: { | ||
jobId: 1, | ||
attemptNum: 1, | ||
userId: 'default-userId', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
sourceId: 'default-sourceId', | ||
secret: { | ||
accessToken: 'default-accessToken', | ||
}, | ||
dontBatch: false, | ||
}, | ||
}, | ||
], | ||
statTags: { | ||
errorCategory: 'network', | ||
errorType: 'retryable', | ||
destType: 'MARKETO', | ||
module: 'destination', | ||
implementation: 'native', | ||
feature: 'dataDelivery', | ||
destinationId: 'default-destinationId', | ||
workspaceId: 'default-workspaceId', | ||
}, | ||
message: 'Request failed with status: 500', | ||
status: 500, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
]; |