-
Notifications
You must be signed in to change notification settings - Fork 111
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
d4aacf1
commit 21b65d0
Showing
6 changed files
with
237 additions
and
6 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
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
86 changes: 86 additions & 0 deletions
86
test/integrations/destinations/salesforce_oauth/dataDelivery/business.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,86 @@ | ||
import { ProxyV1TestData } from '../../../testTypes'; | ||
import { generateProxyV1Payload } from '../../../testUtils'; | ||
import { | ||
commonRequestParameters, | ||
proxyMetdata, | ||
reqMetadataArray, | ||
} from '../../salesforce/dataDelivery/business'; | ||
|
||
const statTags = { | ||
aborted: { | ||
destType: 'SALESFORCE_OAUTH', | ||
destinationId: 'dummyDestinationId', | ||
errorCategory: 'network', | ||
errorType: 'aborted', | ||
feature: 'dataDelivery', | ||
implementation: 'native', | ||
module: 'destination', | ||
workspaceId: 'dummyWorkspaceId', | ||
}, | ||
retryable: { | ||
destType: 'SALESFORCE_OAUTH', | ||
destinationId: 'dummyDestinationId', | ||
errorCategory: 'network', | ||
errorType: 'retryable', | ||
feature: 'dataDelivery', | ||
implementation: 'native', | ||
module: 'destination', | ||
workspaceId: 'dummyWorkspaceId', | ||
}, | ||
throttled: { | ||
destType: 'SALESFORCE_OAUTH', | ||
destinationId: 'dummyDestinationId', | ||
errorCategory: 'network', | ||
errorType: 'throttled', | ||
feature: 'dataDelivery', | ||
implementation: 'native', | ||
module: 'destination', | ||
workspaceId: 'dummyWorkspaceId', | ||
}, | ||
}; | ||
|
||
export const testScenarios: ProxyV1TestData[] = [ | ||
{ | ||
id: 'salesforce_v1_scenario_6', | ||
name: 'salesforce_oauth', | ||
description: '[Proxy v1 API] :: Test for invalid grant scenario due to authentication failure', | ||
successCriteria: | ||
'Should return 400 with error message "invalid_grant" due to "authentication failure"', | ||
scenario: 'Business', | ||
feature: 'dataDelivery', | ||
module: 'destination', | ||
version: 'v1', | ||
input: { | ||
request: { | ||
body: generateProxyV1Payload( | ||
{ | ||
...commonRequestParameters, | ||
endpoint: 'https://rudderstack.my.salesforce.com/services/data/v50.0/sobjects/Lead/6', | ||
}, | ||
reqMetadataArray, | ||
), | ||
method: 'POST', | ||
}, | ||
}, | ||
output: { | ||
response: { | ||
status: 200, | ||
body: { | ||
output: { | ||
message: | ||
'Salesforce Request Failed: "400" due to "{"error":"invalid_grant","error_description":"authentication failure"}", (Aborted) during Salesforce Response Handling', | ||
response: [ | ||
{ | ||
error: '{"error":"invalid_grant","error_description":"authentication failure"}', | ||
metadata: proxyMetdata, | ||
statusCode: 400, | ||
}, | ||
], | ||
statTags: statTags.aborted, | ||
status: 400, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
]; |
3 changes: 2 additions & 1 deletion
3
test/integrations/destinations/salesforce_oauth/dataDelivery/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,3 +1,4 @@ | ||
import { testScenariosForV1API } from './oauth'; | ||
import { testScenarios } from './business'; | ||
|
||
export const data = [...testScenariosForV1API]; | ||
export const data = [...testScenariosForV1API, ...testScenarios]; |
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