-
Notifications
You must be signed in to change notification settings - Fork 35
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
Showing
9 changed files
with
192 additions
and
33 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
30 changes: 30 additions & 0 deletions
30
...stance/testBU/importFile/testExisting_importFile_updateNotifications.importFile-meta.json
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,30 @@ | ||
{ | ||
"allowErrors": true, | ||
"createdDate": "2022-11-09T05:32:30.533", | ||
"customerKey": "testExisting_importFile_updateNotifications", | ||
"dateFormatLocale": "en-US", | ||
"deleteFile": false, | ||
"description": "updated on deploy", | ||
"fieldMappingType": "InferFromColumnHeadings", | ||
"fieldMappings": [], | ||
"fileNamingPattern": "blabla", | ||
"fileTransferLocationTypeId": 0, | ||
"fileType": "CSV", | ||
"filter": "", | ||
"hasColumnHeader": true, | ||
"isOrderedImport": true, | ||
"isSequential": true, | ||
"maxFileAgeHours": 0, | ||
"maxFileAgeScheduleOffsetHours": 0, | ||
"maxImportFrequencyHours": 0, | ||
"modifiedDate": "2022-11-17T07:13:03.95", | ||
"name": "testExisting_importFile_updateNotifications", | ||
"sendEmailNotification": true, | ||
"notificationEmailAddress": "[email protected]", | ||
"standardQuotedStrings": true, | ||
"r__fileLocation_name": "ExactTarget Enhanced FTP", | ||
"c__destinationType": "DataExtension", | ||
"r__dataExtension_CustomerKey": "testExisting_dataExtension", | ||
"c__subscriberImportType": "DataExtension", | ||
"c__dataAction": "AddUpdate" | ||
} |
31 changes: 31 additions & 0 deletions
31
...n/v1/imports/9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications/patch-response.json
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,31 @@ | ||
{ | ||
"allowErrors": true, | ||
"customerKey": "testExisting_importFile_updateNotifications", | ||
"dateFormatLocale": "en-US", | ||
"deleteFile": false, | ||
"description": "updated on deploy", | ||
"fieldMappingType": "InferFromColumnHeadings", | ||
"fieldMappings": [], | ||
"fileNamingPattern": "blabla", | ||
"fileTransferLocationTypeId": 0, | ||
"fileType": "CSV", | ||
"filter": "", | ||
"hasColumnHeader": true, | ||
"isOrderedImport": true, | ||
"isSequential": true, | ||
"maxFileAgeHours": 0, | ||
"maxFileAgeScheduleOffsetHours": 0, | ||
"maxImportFrequencyHours": 0, | ||
"name": "testExisting_importFile_updateNotifications", | ||
"sendEmailNotification": false, | ||
"standardQuotedStrings": true, | ||
"fileTransferLocationId": "41a5ded7-0d98-4910-a15f-d09e7ab0af24", | ||
"destinationObjectId": "21711373-72c1-ec11-b83b-48df37d1deb7", | ||
"destinationObjectTypeId": 310, | ||
"subscriberImportTypeId": 255, | ||
"updateTypeId": 0, | ||
"importDefinitionId": "9d16f42c-2260-ed11-b849-48df37d1de8b_updateNotifications", | ||
"createdDate": "2022-11-09T05:53:03.243", | ||
"destinationId": 0, | ||
"modifiedDate": "2023-07-18T09:11:26.19" | ||
} |
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
30 changes: 30 additions & 0 deletions
30
test/resources/9999999/importFile/patch_updateNotifications-expected.json
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,30 @@ | ||
{ | ||
"allowErrors": true, | ||
"createdDate": "2022-11-09T05:32:30.533", | ||
"customerKey": "testExisting_importFile_updateNotifications", | ||
"dateFormatLocale": "en-US", | ||
"deleteFile": false, | ||
"description": "updated on deploy", | ||
"fieldMappingType": "InferFromColumnHeadings", | ||
"fieldMappings": [], | ||
"fileNamingPattern": "blabla", | ||
"fileTransferLocationTypeId": 0, | ||
"fileType": "CSV", | ||
"filter": "", | ||
"hasColumnHeader": true, | ||
"isOrderedImport": true, | ||
"isSequential": true, | ||
"maxFileAgeHours": 0, | ||
"maxFileAgeScheduleOffsetHours": 0, | ||
"maxImportFrequencyHours": 0, | ||
"modifiedDate": "2022-11-17T07:13:03.95", | ||
"name": "testExisting_importFile_updateNotifications", | ||
"sendEmailNotification": true, | ||
"notificationEmailAddress": "[email protected]", | ||
"standardQuotedStrings": true, | ||
"r__fileLocation_name": "ExactTarget Enhanced FTP", | ||
"c__destinationType": "DataExtension", | ||
"r__dataExtension_CustomerKey": "testExisting_dataExtension", | ||
"c__subscriberImportType": "DataExtension", | ||
"c__dataAction": "AddUpdate" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,11 @@ describe('type: importFile', () => { | |
describe('Retrieve ================', () => { | ||
it('Should retrieve a importFile', async () => { | ||
// WHEN | ||
await handler.retrieve('testInstance/testBU', ['importFile']); | ||
await handler.retrieve( | ||
'testInstance/testBU', | ||
['importFile'], | ||
['testExisting_importFile'] | ||
); | ||
// THEN | ||
assert.equal(process.exitCode, false, 'retrieve should not have thrown an error'); | ||
// get results from cache | ||
|
@@ -54,8 +58,8 @@ describe('type: importFile', () => { | |
const result = cache.getCache(); | ||
assert.equal( | ||
result.importFile ? Object.keys(result.importFile).length : 0, | ||
2, | ||
'two importFiles expected' | ||
3, | ||
'three importFiles expected' | ||
); | ||
// confirm created item | ||
assert.deepEqual( | ||
|
@@ -72,7 +76,7 @@ describe('type: importFile', () => { | |
// check number of API calls | ||
assert.equal( | ||
testUtils.getAPIHistoryLength(), | ||
12, | ||
13, | ||
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' | ||
); | ||
return; | ||
|
@@ -183,4 +187,40 @@ describe('type: importFile', () => { | |
return; | ||
}); | ||
}); | ||
describe('Update email notifications for an importFile ================', () => { | ||
beforeEach(() => { | ||
testUtils.mockSetup(true); | ||
}); | ||
it('Should update email notifications', async () => { | ||
handler.setOptions({ completionEmail: '[email protected]' }); | ||
// WHEN | ||
await handler.updateNotifications('testInstance/testBU', 'importFile', [ | ||
'testExisting_importFile_updateNotifications', | ||
]); | ||
// THEN | ||
assert.equal( | ||
process.exitCode, | ||
false, | ||
'updateNotifications should not have thrown an error' | ||
); | ||
assert.deepEqual( | ||
await testUtils.getActualDeployJson( | ||
'testExisting_importFile_updateNotifications', | ||
'importFile' | ||
), | ||
await testUtils.getExpectedJson( | ||
'9999999', | ||
'importFile', | ||
'patch_updateNotifications' | ||
), | ||
'returned deployment JSON was not equal expected' | ||
); | ||
assert.equal( | ||
testUtils.getAPIHistoryLength(), | ||
21, | ||
'Unexpected number of requests made. Run testUtils.logAPIHistoryDebug() to see the requests' | ||
); | ||
return; | ||
}); | ||
}); | ||
}); |